Re: [go-nuts] truncate float32 to lesser precision (22 bit mantissa)

2016-09-21 Thread Michael Jones
, but that died with SGI. -Original Message- From: <nigel.tao.gn...@gmail.com> on behalf of Nigel Tao <nigel...@golang.org> Date: Wednesday, September 21, 2016 at 4:26 PM To: Xio Fen <xiiop...@gmail.com> Cc: golang-nuts <golang-nuts@googlegroups.com> Subject: Re: [g

Re: [go-nuts] truncate float32 to lesser precision (22 bit mantissa)

2016-09-21 Thread Nigel Tao
On Sun, Sep 18, 2016 at 1:57 PM, wrote: > It looked like I would have to use pkg unsafe BTW, you don't have to use package unsafe. Use package math's Float32bits and Float32frombits functions. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] truncate float32 to lesser precision (22 bit mantissa)

2016-09-21 Thread Michael Jones
Any kind of computational geometry code will have subtle issues in just this area. Broadly, the issue is classification of a point or line as IN, OUT, or ON. Of these, ‘ON’ is the difficult one because floating point prevents perfect calculation where real numbers would allow it. This is