I need an equivalent to C's pow() function that will work with NSDecimalNumbers. With pow you can use negative numbers e.g. pow(1514,-1234)
, with NSDecimal's decimalNumberByRaisingToPower: method, you are forced to use an NSUInteger which seems to require a positive value.
I'd like to be able to do something like this:
[decimalNumber decimalNumberByRaisingToPower:-217.089218];
or
[decimalNumber decimalNumberByMultiplyingByPowerOf10:-217];
without crashing from overflow or underflow exceptions.