I'm getting very small conversion errors from doubleValue when the receiver is an NSDecimalNumber or an NSString... for example:
If the input string (tmpString) is "3.4", the output of tmpValue is 3.399999999999
Is there anything that can be done? NSScanner does the same thing, other input values have precision errors where the precision of a double comes into play, but I would not have expected these results.
Any insight is appreciated!!!
Code:
NSDecimalNumber *dNumber = [NSDecimalNumber decimalNumberWithString:tmpString];
double tmpValue = [dNumber doubleValue];
If the input string (tmpString) is "3.4", the output of tmpValue is 3.399999999999
Is there anything that can be done? NSScanner does the same thing, other input values have precision errors where the precision of a double comes into play, but I would not have expected these results.
Any insight is appreciated!!!