Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jordanlewis
Copy link
Contributor

Previously, float4 values were incorrectly parsed by this library. For
example, a value of 1.2::float4 would be returned to the user as a
float64 of 1.2000000476837158. Now, float4s are parsed correctly,
using the 64-bit-float string parsing facility, and return 1.2 as
expected. Note that this problem only showed up if you used the returned
float64 value from lib/pq directly - casting to a float32 would make the
problem stay hidden - but since lib/pq returns float64, we should make
an effort for that value to be correct anyway.

This was found during investigation here: cockroachdb/cockroach#36811

@jordanlewis
Copy link
Contributor Author

@mjibson could you PTAL?

@knz
Copy link

knz commented May 3, 2019

LGTM

Previously, float4 values were incorrectly parsed by this library. For
example, a value of `1.2::float4` would be returned to the user as a
float64 of `1.2000000476837158`. Now, float4s are parsed correctly,
using the 64-bit-float string parsing facility, and return 1.2 as
expected. Note that this problem only showed up if you used the returned
float64 value from lib/pq directly - casting to a float32 would make the
problem stay hidden - but since lib/pq returns float64, we should make
an effort for that value to be correct anyway.
@madelynnblue madelynnblue merged commit bc6a3c0 into lib:master May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants