Christian Schneider wrote:
George Whiffen wrote:
As you either already know or could reasonably guess, my personal
view is that simple, consistent, exact decimal arithmetic is highly desirable for any development tool intended for either
novices or commercial use.
I use BCMath for critical (e.g. money) calculations as I'd never trust floating point, with or without your fixes. Especially since I'm dealing with big numbers.
- Chris
Chris,
Exactly my point. When coding php you need floating point you can trust or it is useless. As I said, bc is probably the best currently available approach.
Presumably you trust bc because either you've checked the code yourself or you trust the guys who wrote it and say it works.
So what we need with my fixes is for you to check the code/theory yourself or to have someone you trust to do it for you. So, who would you trust?
If I'm wrong, and it's really only bc that can be trusted to add 0.1 and
0.1, then shouldn't we be using that internally, rather than pretending to have a useable fp decimal arithmetic?
George
P.S. I'm interested that you have money numbers so big that 15 digits are not enough. It can't be gross world income which still isn't up to $1e15 and certainly is never quoted to the dollar. I can only guess that it's global currency market volumes you are handling. Do they really quote them to the dollar?
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php