|Subject:||Bug in [NSScanner scanDouble:]|
|Date:||Mon, 28 Dec 2020 22:27:18 +0000|
Hi, sorry for posting a bug report here, but I seem to have lost my credentials for accessing the bug tracker.
The scanDouble: method of NSScanner is adding a tiny fraction to the value scanned (at least on Windows).
NSScanner *scanner = [NSScanner scannerWithString:@“197319600.000000”];
double val = 0.0;
NSLog(@"scanDouble got: %.9f", val);
// results in val having the value 197319600.00000012
Note that NSString’s doubleValue method doesn’t have this problem, so I’m using that to work around this problem for now.
|[Prev in Thread]||Current Thread||[Next in Thread]|