Re: Odd [math] behavior
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 52778
interpreted = N
texte = I cringed when I saw this thread, knowing that it would lead to a discussionof the inaccuracies of binary representation of decimal numbers.I got a kick out of the following quote (taken from one of the links Johnprovided - Thanks, John!)."Floating point is by its nature inexact. It is probably best if youimagined that after every floating point operation, a little demon came inand added or subtracted a tiny number to fuzz the low order bits of yourresult..."I am sure that even the most experienced programmer has gotten 'bit' bythis.So, I think the lesson here is to ALWAYS keep in mind the desired'precision' when performing floating point arithmetic and use the [formatx.xf] to ensure that you get what you expect.FEEDBACK REQUEST: Given that most WebDNA programmers would not expect tohave to deal with those 'fuzzy' low order bits, perhaps we should build in amore user-friendly default precision for the MATH context. Maybe have itcontrolled via a new WebDNA pref? Any thoughts?-----Original Message-----From: John Peacock [mailto:jpeacock@rowman.com]Sent: Thursday, September 11, 2003 12:23 PMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: Odd [math] behaviourPaul Willis wrote:> I fully agree, I don't understand why any calculations or formattingare> 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 smallest child.Theadvantage of using a computer over a child is that the computer actuallydoeswhat 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.htmlhttp://mindprod.com/jgloss/floatingpoint.htmlhttp://www.rwc.uc.edu/koehler/comath/14.htmlHTHJohn--John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4501 Forbes BoulevardSuite HLanham, MD 20706301-459-3366 x.5010fax 301-429-5748-------------------------------------------------------------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:
I cringed when I saw this thread, knowing that it would lead to a discussionof the inaccuracies of binary representation of decimal numbers.I got a kick out of the following quote (taken from one of the links Johnprovided - Thanks, John!)."Floating point is by its nature inexact. It is probably best if youimagined that after every floating point operation, a little demon came inand added or subtracted a tiny number to fuzz the low order bits of yourresult..."I am sure that even the most experienced programmer has gotten 'bit' bythis.So, I think the lesson here is to ALWAYS keep in mind the desired'precision' when performing floating point arithmetic and use the [formatx.xf] to ensure that you get what you expect.FEEDBACK REQUEST: Given that most WebDNA programmers would not expect tohave to deal with those 'fuzzy' low order bits, perhaps we should build in amore user-friendly default precision for the MATH context. Maybe have itcontrolled via a new WebDNA pref? Any thoughts?-----Original Message-----From: John Peacock [mailto:jpeacock@rowman.com]Sent: Thursday, September 11, 2003 12:23 PMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: Odd [math] behaviourPaul Willis wrote:> I fully agree, I don't understand why any calculations or formattingare> 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 smallest child.Theadvantage of using a computer over a child is that the computer actuallydoeswhat 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.htmlhttp://mindprod.com/jgloss/floatingpoint.htmlhttp://www.rwc.uc.edu/koehler/comath/14.htmlHTHJohn--John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4501 Forbes BoulevardSuite HLanham, MD 20706301-459-3366 x.5010fax 301-429-5748-------------------------------------------------------------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:
PSC recommends what date format yr 2000??? (1997)
Persistant Connections (2000)
Repeating Fields (1997)
WebDNA maxing out processor (2008)
Problems with [Search] param - Mac Plugin b15 (1997)
WebCat2 beta 11 - new prefs ... (1997)
[OT] (waaaay OT) further off topic than before (2004)
Multiple Newcarts (1996)
problems with 2 tags (1997)
XML Syntax, Cookies and Variables.... (2004)
Include vs. lookup? (1998)
Summing fields (1997)
The IBC root beer has arrived! (1997)
Zeroing out shipping costs (2000)
Multiple Stores and WebCatalog Prefs (1997)
SMSI FTP - calander system (2002)
Help with Repost Data msg from form (1997)
Moving files from one server to another... (2001)
FEW QUESTIONS (1997)
OK, here goes... (1997)