I have an NSDecimal in a tight calculations loop, where I need to floor the value. I want to prevent creating fat NSDecimalNumber objects just for that. Is there a cost-efficient way to get a floor? That floor is just needed to calculate how many times another value might fit in there, with no rest. The NSDecimal API doesn't provide something like floor...
+1
A:
NSDecimal result;
NSDecimalRound(&result, &decimal, 0, NSRoundDown);
(not tested)
Wevah
2009-08-26 21:29:23