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:

Show shoppingcart after remove last item (1997) Calendar (1997) Google does it... can WebDNA? Showing only the section (2003) carriage returns in data (1997) Has anyone used WebCatalog with CGatePro? (2000) Close-to Comparison Code (1998) RE: PCS search results page (1998) RE: WebCat 3.0 Serial Numbers (1999) Help needed! (1998) Multiple Users.db Possible? (1997) redirect from the errorsMessages.db entry (1997) writing orders to a db (1997) Mime Headers for Mail (1998) Pricelist (1999) Secure server question (1997) [WebDNA] WebDNA install on Redhat 4 64 bit? (2008) Multiple security dbs (1997) [writefile] (1997) Bug Report, maybe (1997) Text limits in NT version? (1997)