Improve string-to-float roundtrip checking.
The previous implementation ran into trouble on older versions of
libc++; very large values were getting rounded up to INF incorrectly.
We now work around this issue by reading back into a double and then
casting down to float.
Also, previously, the code was conflating doubles and floats. We
doesn't ever call skstd::to_string(double) in Skia today, but if
someone does call it in the future, we will now show the proper
precision.
Change-Id: Id97f8e09e6fffa7538ce6a165d75eb7c25de4c2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/587536
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1 file changed