I need the equivalent of the C pow () function, which will work with NSDecimalNumbers. With pow, you can use negative numbers, for example. pow(1514,-1234), with the NSDecimal decimalNumberByRaisingToPower: method, you are forced to use the NSUInteger, which seems to require a positive value.
I would like to do something like this:
[decimalNumber decimalNumberByRaisingToPower:-217.089218]
or
[decimalNumber decimalNumberByMultiplyingByPowerOf10:-217]
no failures due to overflow or overflow exceptions.
source
share