• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
flummoxed by math failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: flummoxed by math failure
      • From: "Angela Brett" <email@hidden>
  • Prev by Date: RE: Can a subclass of NSDictionary do this?
  • Next by Date: Re: Can a subclass of NSDictionary do this?
  • Previous by thread: Re: Can a subclass of NSDictionary do this?
  • Next by thread: Re: flummoxed by math failure
  • Index(es):
    • Date
    • Thread