From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Fri, 26 Mar 2010 12:58:28 +0100 Message-ID: <138575261003260458l18239e6cm9cce321b273d18d@mail.gmail.com> From: hugo rivera To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: [9fans] float overflow Topicbox-Message-UUID: f38ba304-ead5-11e9-9d60-3106f5b1d025 Hello, float operations are causing me some headaches on plan 9 (9vx). I have a program that crashes badly when I feed it with near-the-top doubles ~1.1e308. This causes an overflow in a function that needs to square this values and acid points the line where the first call to pow(2) occurs when I debug it. The problem is that this doesn't happen at all when the program is compiled with gcc (9c) on linux. Obviously my results aren't useful, but I get '+Inf' on my output and the program doesn't crash. I thought of using isInf(2) to avoid Infs in my operations, but this would make the code really ugly and probably slow. I've seen that hoc also suffers from this. On 9vx % echo 1.75e308+1.75e308 | hoc hoc 851: suicide: sys: trap: 19 (reserved) pc=0x00003a75 but on linux echo 1.75e308+1.75e308 | hoc +Inf is there something I can do to remedy this situation? maybe this doesn't happen on a native plan 9 installation, but I don't have access to any. Saludos, -- Hugo