Re: Odd [math] behaviour

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 52774
interpreted = N
texte = 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. Webcat seems to have no problem with these other difficult sums... 6.0004-5.3003=0.7001 60.004-53.003=7.001 600.04-530.03=70.01 6000.4-5300.3=700.099999999999 60004-53003=7001 600040-530030=70010 60.4-53.3=7.1 600.4-530.3=70.1 60000.4-53000.3=7000.1 600000.4-530000.3=70000.1 Paul On Thursday, September 11, 2003, at 07:50 pm, Donovan wrote: > Since my background is art rather than math ;-)... > > I'm haveing difficulty understanding this. > > On my calculator: > If I take 3.2/3 I get 1.06 - repeating > If I take 6000.4-5300.3 I get 700.1 > > How again does [math][/math] interpret this differently? > > sorry if my brain is thick. > (I'll blaim it on the late 80's) > > Donovan > > > > John Peacock wrote: > [snip] >> It's your computer, not WebDNA. Floating point math is not exact; it >> is approximate. Certain combinations will not ever work in the way >> you are used to "on paper" so you just have to deal with it. >> I see that round() is not a valid function within the [math] (which >> is dumb), so you'll have to brew your own: >> [math]floor((6000.4-5300.3+0.005)*100)/100[/math] >> will display what you would expect. >> NOTE: because you are using floating point, even the above may not >> work all of the time, because some decimal representations are not >> possible to accurately store using floating point numbers (which are >> stored internally as a power of 2 not 10). >> HTH >> John > > > > -- > =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o > DONOVAN D. BROOKE > Eucalyptus Design > Developer / Consultant > <-Web Development (specializing in eCommerce), -> > <-Graphic Design, and Pre-Press Consultation -> > > ADDRESS:> Donovan Brooke > DBA Eucalyptus Design > P.O. Box 260153 > Madison, WI 53726-0153 > > PH:> 1.608.592.3567 > email:> dbrooke@euca.us > Web:> http://www.euca.us > =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o > > > ------------------------------------------------------------- > 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/ > ------------------------------------------------------------- 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: Odd [math] behaviour ( Tim Robinson 2003)
  2. Re: Odd [math] behaviour ( John Peacock 2003)
  3. Re: Odd [math] behaviour ( Paul Willis 2003)
  4. Re: Odd [math] behaviour ( Donovan 2003)
  5. Re: Odd [math] behaviour ( John Peacock 2003)
  6. Re: Odd [math] behaviour ( "WebDna @" 2003)
  7. Re: Odd [math] behaviour ( John Peacock 2003)
  8. Re: Odd [math] behaviour ( Donovan 2003)
  9. Re: Odd [math] behaviour ( "WebDna @" 2003)
  10. Re: Odd [math] behaviour ( Pat Holliday 2003)
  11. Re: Odd [math] behaviour ( "WebDna @" 2003)
  12. Re: Odd [math] behaviour ( John Peacock 2003)
  13. Odd [math] behaviour ( Pat Holliday 2003)
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. Webcat seems to have no problem with these other difficult sums... 6.0004-5.3003=0.7001 60.004-53.003=7.001 600.04-530.03=70.01 6000.4-5300.3=700.099999999999 60004-53003=7001 600040-530030=70010 60.4-53.3=7.1 600.4-530.3=70.1 60000.4-53000.3=7000.1 600000.4-530000.3=70000.1 Paul On Thursday, September 11, 2003, at 07:50 pm, Donovan wrote: > Since my background is art rather than math ;-)... > > I'm haveing difficulty understanding this. > > On my calculator: > If I take 3.2/3 I get 1.06 - repeating > If I take 6000.4-5300.3 I get 700.1 > > How again does [math][/math] interpret this differently? > > sorry if my brain is thick. > (I'll blaim it on the late 80's) > > Donovan > > > > John Peacock wrote: > [snip] >> It's your computer, not WebDNA. Floating point math is not exact; it >> is approximate. Certain combinations will not ever work in the way >> you are used to "on paper" so you just have to deal with it. >> I see that round() is not a valid function within the [math] (which >> is dumb), so you'll have to brew your own: >> [math]floor((6000.4-5300.3+0.005)*100)/100[/math] >> will display what you would expect. >> NOTE: because you are using floating point, even the above may not >> work all of the time, because some decimal representations are not >> possible to accurately store using floating point numbers (which are >> stored internally as a power of 2 not 10). >> HTH >> John > > > > -- > =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o > DONOVAN D. BROOKE > Eucalyptus Design > Developer / Consultant > <-Web Development (specializing in eCommerce), -> > <-Graphic Design, and Pre-Press Consultation -> > > ADDRESS:> Donovan Brooke > DBA Eucalyptus Design > P.O. Box 260153 > Madison, WI 53726-0153 > > PH:> 1.608.592.3567 > email:> dbrooke@euca.us > Web:> http://www.euca.us > =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o > > > ------------------------------------------------------------- > 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/ > ------------------------------------------------------------- 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/ Paul Willis

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:

triggering an update of two frames (1998) [format 40s]text[/format] doesn't work (1997) Error Lob.db records error message not name (1997) 2.0 Info (1997) Simple way to create unique SKU (1997) search between two dates (2003) relogin same user? (1998) catagories (1997) Accented chars and emailer (1998) WebDNA 5.0 Questions (2003) WebCat Beta NT 18 (1997) Multi-processor Mac info ... (1997) international time (1997) [WebDNA] New Mountain Lion OSX Server (2013) plugin-acgi, different results (1997) [WebDNA] Strange MATH result (2010) WebCat2b13 Command Reference Doc error (1997) setting values (1998) Cookies (1999) [WebDNA] macOS 10.13.3 and WebDNA Mac Server 8.5.1 - hick-up (2019)