flummoxed by math failure
flummoxed by math failure
- Subject: flummoxed by math failure
- From: Dean Tresner <email@hidden>
- Date: Tue, 22 Jul 2003 17:09:18 -0600
I have a program that I recently converted from using floats to
NSDecimalNumbers. For a while everything worked fine but it gradually
got worse and now doesn't work at all. To boil it down to basics, the
following code, which compiles without warnings:
NSDecimalNumber *t;
t = [[self hours] decimalNumberByMultiplyingBy:[self rate]]; //
withBehavior:numBehavior];
NSLog([NSString stringWithFormat:@"%@ X %@ = %@", [hours description],
[rate description], [t description]]);
Run through twice produces:
2003-07-22 16:43:50.888 Work Timer[8128] 1 X 100 = 0
2003-07-22 16:43:50.888 Work Timer[8128] 2 X 100 = 0
What gives?
I'm using the Dec. '02 tools.
Dean
_______________________________________________
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.