From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Tue, 26 Oct 2010 19:12:14 -0700 Message-ID: Subject: 5c ulong/vlong -> float64 bug From: Russ Cox To: 9fans <9fans@9fans.net>, inferno-list@vitanuova.com Content-Type: text/plain; charset=UTF-8 Topicbox-Message-UUID: 6e73943c-ead6-11e9-9d60-3106f5b1d025 For those people using 5c, I found a bug recently in the conversion of ulong to float64. The bug is that it's not implemented at all; instead 5c uses the long to float64 code, so converting 0x80000000 produces -2^31 not 2^31. This matters in _v2d, which uses it to convert vlong to float64. If the low 32 bits of the vlong have the high bit set, the conversion ends up off by 2^32. http://codereview.appspot.com/2726041 has a straightforward but perhaps inefficient fix. Russ