Doug,

Regarding where to file... you can do it on github.  That shouldn't be a
problem.

I'm curious, could this be a rounding error?  Double is supposed to have a
precision of 15 decimal places.

Yours, GC

On Mon, Dec 28, 2020 at 6:30 PM Douglas Simons <
[email protected]> wrote:

> 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;
> [scanner scanDouble:&val];
> 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.
>
> Thanks!
>
> Doug
>


-- 
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
https://www.patreon.com/bePatron?u=352392 - Become a Patron
https://gf.me/u/x8m3sx - My GNUstep GoFundMe
https://teespring.com/stores/gnustep - Store

Reply via email to