Re: number formatting
Re: number formatting
- Subject: Re: number formatting
- From: email@hidden
- Date: Sat, 23 Feb 2002 13:23:59 -0800
Lance, have you read what people have been telling you? Floating point
values don't have exact representations inside the machine.
Run this code and watch it in the debugger.
float value = 0.35;
printf("floating point value: %f\n", value);
The value is represented in the machine as 0.34999...
To force it to show up as 0.35 in a text field the text field would have
to force the precision to 2 places. Then you'd be still complaining
about
the cases where you wanted more or less precision.
I believe what Lance is really arguing for is an infinite-precision
numeric type in Cocoa. Which, I will admit, would be useful for many
applications. :->
Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.