Re: [PHP] Simple math failing - PHP Bug?

2004-11-05 Thread Olaf van der Spek
Mike Ford wrote: for. (Some early business-oriented computers, and some calculators (especially financial ones) did use a system called binary-coded decimal -- BCD -- to calculate accurately in the sense you mean, but the fact that they were never widely used and have died out almost totally

RE: [PHP] Simple math failing - PHP Bug?

2004-11-05 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 05 November 2004 10:42, Olaf van der Spek wrote: Mike Ford wrote: for. (Some early business-oriented computers, and some calculators (especially financial ones) did use a

Re: [PHP] Simple math failing - PHP Bug?

2004-11-01 Thread Mark Charette
From: Chris Shiflett [EMAIL PROTECTED] To: Jason Wong [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, November 01, 2004 12:22 AM Subject: Re: [PHP] Simple math failing - PHP Bug? --- Jason Wong [EMAIL PROTECTED] wrote: Most computer languages handling floating point calculations just as poorly

RE: [PHP] Simple math failing - PHP Bug?

2004-11-01 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 01 November 2004 06:31, Brian T. Allen wrote: [] When adding dollar amounts using only whole cents (and excluding the limitation we've been discussing) you should always

[PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Brian T. Allen
Hi, OK, I'm totally stumped by this. This should be the simplest math imaginable (addition and subtraction), but PHP is coming up with the wrong answer! I've checked on 3 different machines (all linux) running both PHP 4 and PHP 5. Here is the code to duplicate the problem:

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Thomas Goyne
On Sun, 31 Oct 2004 21:52:32 -0700, Brian T. Allen [EMAIL PROTECTED] wrote: Hi, OK, I'm totally stumped by this. This should be the simplest math imaginable (addition and subtraction), but PHP is coming up with the wrong answer! [snip] Is this legitimately bad math on the part of PHP?

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Jason Wong
On Monday 01 November 2004 04:52, Brian T. Allen wrote: OK, I'm totally stumped by this. This should be the simplest math imaginable (addition and subtraction), but PHP is coming up with the wrong answer! I've checked on 3 different machines (all linux) running both PHP 4 and PHP 5.

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Chris Shiflett
--- Jason Wong [EMAIL PROTECTED] wrote: Most computer languages handling floating point calculations just as poorly. If accuracy is important use the BCMath functions. Or use Fortran and double precision. :-) Still, testing a floating point number as a boolean is one of the worst ideas I've

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Brian T. Allen
Thomas Goyne wrote: On Sun, 31 Oct 2004 21:52:32 -0700, Brian T. Allen [EMAIL PROTECTED] wrote: Hi, OK, I'm totally stumped by this. This should be the simplest math imaginable (addition and subtraction), but PHP is coming up with the wrong answer! [snip] Is this legitimately bad math on

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Brian T. Allen
Chris Shiflett wrote: --- Jason Wong [EMAIL PROTECTED] wrote: Most computer languages handling floating point calculations just as poorly. If accuracy is important use the BCMath functions. Or use Fortran and double precision. :-) Still, testing a floating point number as a boolean is one

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Chris Shiflett
--- Brian T. Allen [EMAIL PROTECTED] wrote: Well, in fairness, it's one of the worst ideas you've ever heard because you know of this limitation. Of course. That wasn't a dig at you or anything - just a comment. You're free to heed or ignore it. In reality, using a calculator or something

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Brian T. Allen
Chris Shiflett wrote: --- Brian T. Allen [EMAIL PROTECTED] wrote: Well, in fairness, it's one of the worst ideas you've ever heard because you know of this limitation. Of course. That wasn't a dig at you or anything - just a comment. You're free to heed or ignore it. In reality, using a

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread M. Sokolewicz
Brian T. Allen wrote: Chris Shiflett wrote: --- Brian T. Allen [EMAIL PROTECTED] wrote: Well, in fairness, it's one of the worst ideas you've ever heard because you know of this limitation. Of course. That wasn't a dig at you or anything - just a comment. You're free to heed or ignore it.

Re: [PHP] Simple math failing - PHP Bug?

2004-10-31 Thread Thomas Goyne
On Sun, 31 Oct 2004 23:30:53 -0700, Brian T. Allen [EMAIL PROTECTED] wrote: No worries, this isn't personal. I just want to explore this limitation and it's implications for my benefit and the benefit of any that read this thread later when they are searching for answers to a similar