Re: [go-nuts] Hexadecimal floats

2019-07-27 Thread Jan Mercl
On Sat, Jul 27, 2019 at 7:44 AM Adrian Ho wrote: It works: https://gitlab.com/cznic/qbe/commit/0cdebdce50edb146df981b6b484bad57eddb9e94#97b5d71a8f6b71eb5bf032969fb4a29f9d89eef4_1175_1177 Thanks again. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Hexadecimal floats

2019-07-26 Thread Jan Mercl
There are several NaNs, but only a single bit pattern for IEEE754 infinity (modulo the sign bit). So yes, your suggestion should work well. Thank you, I'll give it a try. On Sat, Jul 27, 2019, 07:44 Adrian Ho wrote: > On 26/7/19 9:20 PM, Jan Mercl wrote: > > In a program that generates C, I'm

Re: [go-nuts] Hexadecimal floats

2019-07-26 Thread Adrian Ho
On 26/7/19 9:20 PM, Jan Mercl wrote: > In a program that generates C, I'm using big.Float.Text > (https://golang.org/pkg/math/big/#Float.Text) to produce the exact > value of the C floating point literal. As it turns out, the function > does not support Inf values. Instead of encoding the exact

[go-nuts] Hexadecimal floats

2019-07-26 Thread Jan Mercl
In a program that generates C, I'm using big.Float.Text (https://golang.org/pkg/math/big/#Float.Text) to produce the exact value of the C floating point literal. As it turns out, the function does not support Inf values. Instead of encoding the exact bits of the Inf value, the resulting string is