Re: format rounding?!

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39289
interpreted = N
texte = Kalin Mintchev wrote: > > should this [format 8.2f]7.475[/format] produce this: 7.48 ? > > i was just looking at the docs... > If the underlying rounding algorithm is even rounding yes; otherwise no. This may be platform dependent territory. What platform are you running on? I do not see it round under NT (which is wrong): [format 8.2f]7.475[/format]
[format 8.2f]7.485[/format]displays as 7.47 and 7.49which demonstrates that odd rounding is enabled (and this is not the correct method to use, per the IEEE 754 standard).'Even' rounding (also called bankers rounding) is defined such that if the digit before the 5 will become even, then round up, otherwise truncate. There are some long and fairly technical reasons for this, but basically it comes down to making sure that there is no unintentional bias.John-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: format rounding?! (John Peacock 2001)
  2. format rounding?! (Kalin Mintchev 2001)
Kalin Mintchev wrote: > > should this [format 8.2f]7.475[/format] produce this: 7.48 ? > > i was just looking at the docs... > If the underlying rounding algorithm is even rounding yes; otherwise no. This may be platform dependent territory. What platform are you running on? I do not see it round under NT (which is wrong): [format 8.2f]7.475[/format]
[format 8.2f]7.485[/format]displays as 7.47 and 7.49which demonstrates that odd rounding is enabled (and this is not the correct method to use, per the IEEE 754 standard).'Even' rounding (also called bankers rounding) is defined such that if the digit before the 5 will become even, then round up, otherwise truncate. There are some long and fairly technical reasons for this, but basically it comes down to making sure that there is no unintentional bias.John-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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://search.smithmicro.com/ John Peacock

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:

Urgent help needed (1998) NT version (1997) Search returns all, not 20 (1997) Firewalls - What's Good? (1999) Multiple prices (1997) remotely add + sign (1997) Displaying text and populating form fields (2005) $Replace with [founditems] (1997) checkout.tpl (1999) Another form question (2000) [convertchars] HELP!!! (1999) browser info.txt and SSL (1997) Forcing Search w/ URL (1999) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) Browser Info.txt -- newest additions? (1997) Emailer (1997) Summary search -- speed (1997) BGcolor (1997) FYI: virus alert (1996) [WebDNA] Post-Parse Script to remove extra returns. (2009)