Re: Random again

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 47461
interpreted = N
texte = on 2/4/03 7:18 PM, Tim Robinson at tim@idfk.com.au so noted...> A while ago there was some discussion about using [math]ceil([RANDOM > format=float]*(randomrange))[/math] to get a random number. We were just > trying this and came up with an anomaly: including the occasional negative > number!!! (and the negative number always is in the range -480 to -490ish.Mac OS X 10.2.3 WebDNA 4.5I'm seeing the same thing.It looks like every so often, [random format=float] kicks out a very small number that gets converted to scientific notation (like 3.62359e-05) and causes the large negative numbers in the calculation.Forcing the random number to a six-digit float is a kludge that gets around this.Change:ceil([random format=float]*99)To:ceil([format .6f][random format=float][/format]*99)If this is a WebDNA bug, I'll be doing some global search/replace with BBEdit tonight. : ( Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Random again (Rob Marquardt 2003)
  2. Random again (Tim Robinson 2003)
on 2/4/03 7:18 PM, Tim Robinson at tim@idfk.com.au so noted...> A while ago there was some discussion about using [math]ceil([RANDOM > format=float]*(randomrange))[/math] to get a random number. We were just > trying this and came up with an anomaly: including the occasional negative > number!!! (and the negative number always is in the range -480 to -490ish.Mac OS X 10.2.3 WebDNA 4.5I'm seeing the same thing.It looks like every so often, [random format=float] kicks out a very small number that gets converted to scientific notation (like 3.62359e-05) and causes the large negative numbers in the calculation.Forcing the random number to a six-digit float is a kludge that gets around this.Change:ceil([random format=float]*99)To:ceil([format .6f][random format=float][/format]*99)If this is a WebDNA bug, I'll be doing some global search/replace with BBEdit tonight. : ( Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Rob Marquardt

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[Announce] Newest Commerce Site based on WebCatalog (1997) Solution help needed (1998) Narrowing NT Crashing error (2000) duplicating cart items (1998) Gettting IPAddress (2001) price on detail, but not shoppingcart (1997) sort without the or a (1998) docs for WebCatalog2 (1997) [LOOKUP] (1997) More than one db with the same namn (was: WC2f3) (1997) shown next / show prev (1998) WebDNA 5.0 Enterprise Edition (2003) shipping calcs (1998) ShipCosts database (1997) MacAuthorize and WebCatalog Questions (2000) Field validation problem (1999) Any word on upload feature? (2000) Protecting webdelivery (1997) WebDNA4.5 OS-X CPU Usage? (2003) Online reference (1997)