RE: RE: [PHP] round()
| From: | tedd | Date: | Sat, 13 Oct 2007 03:23:59 +0000 |
| Subject: | RE: RE: [PHP] round() | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263171@lists.php.net to get a copy of this message | ||
At 11:08 AM -0700 10/12/07, =?UTF-8?Q?J=C3=BCrgen_Wind?= wrote:
It's a question of what you expect from a rounding function. If you work with reals on a computer you always have a bit of "fuzzynes" due to the internal conversions from float to binary and resulting truncations.It is only "reals" that use a rounding function.
If you need reproducable results which fit your expectations and if speed doesn't matter just use your own routine depending on string comparison.Yes, I can round my own -- one that is more accurate than round(). But, I was wondering if others had observed that round() was not as accurate as other methods -- and that was the point of my initial post. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com