Re: Odd [math] behavior
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 52788
interpreted = N
texte = If we did add a new pref, it would default to 'disabled' so as not to breakany existing code. If one chose to enable it, they would need to handle anyside effects.>What if you allowed a Format specification in the Math context?Well....that IS what the [format] context is for. I generally see nothingwrong with redundancy, just that adding new parameters does cost moreparsing overhead. WebDNA...LEAN and MEAN ;)-----Original Message-----From: Brian Fries [mailto:webdna@brainscansoftware.com]Sent: Thursday, September 11, 2003 1:44 PMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: Odd [math] behaviorWhat if you allowed a Format specification in the Math context?[math format=1.2f]17/7[/math]This could be combined with an OPTIONAL default precision pref, but Iwouldn't want an upgrade installation to break any of my existing math,some of which is pretty complicated and needs a high precision.- brianOn Thursday, September 11, 2003, at 01:15 PM, Scott Anderson wrote:>> I cringed when I saw this thread, knowing that it would lead to a> discussion> of the inaccuracies of binary representation of decimal numbers.>> I got a kick out of the following quote (taken from one of the links> John> provided - Thanks, John!).>> "Floating point is by its nature inexact. It is probably best if you> imagined that after every floating point operation, a little demon> came in> and added or subtracted a tiny number to fuzz the low order bits of> your> result...">> I am sure that even the most experienced programmer has gotten 'bit'by> this.>> So, I think the lesson here is to ALWAYS keep in mind the desired> 'precision' when performing floating point arithmetic and use the> [format> x.xf] to ensure that you get what you expect.>>> FEEDBACK REQUEST: Given that most WebDNA programmers would not expect> to> have to deal with those 'fuzzy' low order bits, perhaps we should> build in a> more user-friendly default precision for the MATH context. Maybe have> it> controlled via a new WebDNA pref? Any thoughts?>>>>>>> -----Original Message-----> From: John Peacock [mailto:jpeacock@rowman.com]> Sent: Thursday, September 11, 2003 12:23 PM> To: WebDNA-Talk@talk.smithmicro.com> Subject: Re: Odd [math] behaviour>>> Paul Willis wrote:>>> I fully agree, I don't understand why any calculations or formatting> are>> required. This is simple subtraction. 6000.4-5300.3 is 700.1 a small>> child could do it.>>>> Unfortunately, computers are far stupider than even the smallestchild.> The> advantage of using a computer over a child is that the computer> actually> does> what you tell it to do and does it quickly (no "In a minute Daddy!").>> A quick Google yielded a few useful pages:>> http://www.python.org/doc/current/tut/node14.html> http://mindprod.com/jgloss/floatingpoint.html> http://www.rwc.uc.edu/koehler/comath/14.html>> HTH>> John-------------------------------------------------------------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 toWeb Archive of this list is at: http://webdna.smithmicro.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:
If we did add a new pref, it would default to 'disabled' so as not to breakany existing code. If one chose to enable it, they would need to handle anyside effects.>What if you allowed a Format specification in the Math context?Well....that IS what the [format] context is for. I generally see nothingwrong with redundancy, just that adding new parameters does cost moreparsing overhead. WebDNA...LEAN and MEAN ;)-----Original Message-----From: Brian Fries [mailto:webdna@brainscansoftware.com]Sent: Thursday, September 11, 2003 1:44 PMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: Odd [math] behaviorWhat if you allowed a Format specification in the Math context?[math format=1.2f]17/7[/math]This could be combined with an OPTIONAL default precision pref, but Iwouldn't want an upgrade installation to break any of my existing math,some of which is pretty complicated and needs a high precision.- brianOn Thursday, September 11, 2003, at 01:15 PM, Scott Anderson wrote:>> I cringed when I saw this thread, knowing that it would lead to a> discussion> of the inaccuracies of binary representation of decimal numbers.>> I got a kick out of the following quote (taken from one of the links> John> provided - Thanks, John!).>> "Floating point is by its nature inexact. It is probably best if you> imagined that after every floating point operation, a little demon> came in> and added or subtracted a tiny number to fuzz the low order bits of> your> result...">> I am sure that even the most experienced programmer has gotten 'bit'by> this.>> So, I think the lesson here is to ALWAYS keep in mind the desired> 'precision' when performing floating point arithmetic and use the> [format> x.xf] to ensure that you get what you expect.>>> FEEDBACK REQUEST: Given that most WebDNA programmers would not expect> to> have to deal with those 'fuzzy' low order bits, perhaps we should> build in a> more user-friendly default precision for the MATH context. Maybe have> it> controlled via a new WebDNA pref? Any thoughts?>>>>>>> -----Original Message-----> From: John Peacock [mailto:jpeacock@rowman.com]> Sent: Thursday, September 11, 2003 12:23 PM> To: WebDNA-Talk@talk.smithmicro.com> Subject: Re: Odd [math] behaviour>>> Paul Willis wrote:>>> I fully agree, I don't understand why any calculations or formatting> are>> required. This is simple subtraction. 6000.4-5300.3 is 700.1 a small>> child could do it.>>>> Unfortunately, computers are far stupider than even the smallestchild.> The> advantage of using a computer over a child is that the computer> actually> does> what you tell it to do and does it quickly (no "In a minute Daddy!").>> A quick Google yielded a few useful pages:>> http://www.python.org/doc/current/tut/node14.html> http://mindprod.com/jgloss/floatingpoint.html> http://www.rwc.uc.edu/koehler/comath/14.html>> HTH>> John-------------------------------------------------------------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 toWeb Archive of this list is at: http://webdna.smithmicro.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/
"Scott Anderson"
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:
WebCatalog and Filemaker (1996)
shipCost (1998)
[WAY OFF TOPIC] anybody live in Kansas? (2003)
wierd [cart] action! (1997)
SKU lookup (1997)
Upgrage pricing... The future of WebCatalog is coming (2000)
WebCat2.0 [format thousands .0f] no go (1997)
Locking up with WebCatalog... (1997)
WebCat2b15MacPlugIn - [authenticate] not [protect] (1997)
Calendar Snippet Available (1998)
BUG in [showif] using ^ (contains) (1997)
Re:Emailer setup (1997)
frames & carts (1997)
Access Denied! But why? (1997)
Customizing WebDelivery.html (1998)
[TaxableTotal] - not working with AOL and IE (1997)
dos performance (1998)
BGcolor (1997)
OT: Poll Please (2002)
Re:no [search] with NT (1997)