]> Cypherpunks repositories - gostls13.git/commit
reflect: when Converting between float32s, don't lose signal NaNs
authorKeith Randall <khr@golang.org>
Tue, 3 Mar 2020 18:07:32 +0000 (18:07 +0000)
committerKeith Randall <khr@golang.org>
Wed, 1 Apr 2020 16:41:14 +0000 (16:41 +0000)
commit7ffbea9fd838be851c287b2a21ee6ce1e2776b54
tree79c7c48ce9c5b572990ba825f9e9c0c65900c537
parent8e6a8d9e282a6f9aeab5635c75c223129f5ab61f
reflect: when Converting between float32s, don't lose signal NaNs

Trying this CL again, with a test that skips 387.

When converting from float32->float64->float32, any signal NaNs
get converted to quiet NaNs. Avoid that so using reflect.Value.Convert
between two float32 types keeps the signal bit of NaNs.

Skip the test on 387. I don't see any sane way of ensuring that a
float load + float store is faithful on that platform.

Fixes #36400

Change-Id: Ic316c74ddc155632e40424e207375b5d50dcd853
Reviewed-on: https://go-review.googlesource.com/c/go/+/221792
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/reflect/all_test.go
src/reflect/value.go