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 smallnumber that gets converted to scientific notation (like 3.62359e-05) andcauses the large negative numbers in the calculation.Forcing the random number to a six-digit float is a kludge that gets aroundthis.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 withBBEdit tonight. : (Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.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:
|
- Re: Random again (Rob Marquardt 2003)
- 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 smallnumber that gets converted to scientific notation (like 3.62359e-05) andcauses the large negative numbers in the calculation.Forcing the random number to a six-digit float is a kludge that gets aroundthis.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 withBBEdit tonight. : (Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.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:
What am I missing (1997)
Hiding HTML and breaking the page (1997)
Nested tags count question (1997)
Nested tags count question (1997)
WebDNA Writer Needed (1997)
[WebDNA] Adding hearder fields to a DB (2017)
Non WebDNA forms and timed popups... (2002)
HomePage Caution (1997)
WCS Newbie question (1997)
My slower response (1997)
NY taxRates.db? (1997)
WHY SO MANY DUPLICATES? (1999)
[WebDNA] filter out the exclaimation point (2017)
v6.x & [cart] (2004)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
[ShowIf] and empty fields (1997)
PSC recommends what date format yr 2000??? (1997)
WebCatalog seems to choke on large (2meg) html files. (1998)
WebDNA quitting (2008)
email database file (2005)