<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go.git/test/float_lit3.go, branch dev.garbage</title>
<subtitle>code.google.com: Obsolete (use go-git)
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go.git/'/>
<entry>
<title>test/float_lit2.go: rewrite to test values near boundaries</title>
<updated>2014-05-21T21:12:06+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2014-05-21T21:12:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go.git/commit/?id=563a64b47d6f54188e2301e6b0b26dce599de2b2'/>
<id>563a64b47d6f54188e2301e6b0b26dce599de2b2</id>
<content type='text'>
Add larger comment explaining testing methodology,
and derive tests arithmetically.

(These tests are checking rounding again; the derived
tests they replace were checking exact values.)

LGTM=r, gri
R=gri, r
CC=golang-codereviews
https://codereview.appspot.com/100660044
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add larger comment explaining testing methodology,
and derive tests arithmetically.

(These tests are checking rounding again; the derived
tests they replace were checking exact values.)

LGTM=r, gri
R=gri, r
CC=golang-codereviews
https://codereview.appspot.com/100660044
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/gc: fix float32 const conversion and printing of big float consts</title>
<updated>2014-05-20T02:57:59+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2014-05-20T02:57:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go.git/commit/?id=17b0ba22ea66c4217bef7e9460d7a7d73e8e0173'/>
<id>17b0ba22ea66c4217bef7e9460d7a7d73e8e0173</id>
<content type='text'>
The float32 const conversion used to round to float64
and then use the hardware to round to float32.
Even though there was a range check before this
conversion, the double rounding introduced inaccuracy:
the round to float64 might round the value further away
from the float32 range, reaching a float64 value that
could not actually be rounded to float32. The hardware
appears to give us 0 in that case, but it is probably undefined.
Double rounding also meant that the wrong value might
be used for certain border cases.

Do the rounding the float32 ourselves, just as we already
did the rounding to float64. This makes the conversion
precise and also makes the conversion match the range check.

Finally, add some code to print very large (bigger than float64)
floating point constants in decimal floating point notation instead
of falling back to the precise but human-unreadable binary floating
point notation.

Fixes issue 8015.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://codereview.appspot.com/100580044
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The float32 const conversion used to round to float64
and then use the hardware to round to float32.
Even though there was a range check before this
conversion, the double rounding introduced inaccuracy:
the round to float64 might round the value further away
from the float32 range, reaching a float64 value that
could not actually be rounded to float32. The hardware
appears to give us 0 in that case, but it is probably undefined.
Double rounding also meant that the wrong value might
be used for certain border cases.

Do the rounding the float32 ourselves, just as we already
did the rounding to float64. This makes the conversion
precise and also makes the conversion match the range check.

Finally, add some code to print very large (bigger than float64)
floating point constants in decimal floating point notation instead
of falling back to the precise but human-unreadable binary floating
point notation.

Fixes issue 8015.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://codereview.appspot.com/100580044
</pre>
</div>
</content>
</entry>
</feed>
