[lazarus] SIGFPE in fpc_round

C Western mftq75 at dsl.pipex.com
Sat Nov 29 12:06:10 EST 2003

Mattias Gaertner wrote:

>>>I spotted a bug in current fpc 1.9.1 and the Round function.
>>>I was not able to reproduce the error in a small context or find the bug
>>>in the fpc bug list. Perhaps the needed context has something to do with
>>>the gtk libs. So, maybe someone else knows this bug:
>>>The bug appears in gtkwinapi.inc 7773 in the line
>>>Program received signal SIGFPE, Arithmetic exception.
>>>0x0813ca57 in fpc_round ()
>>>Value is 0, so rounding should be pretty easy.
>>>Adding a writeln(Value); in front "fixes" the bug. 
I have had this sort of problem (though not in your specific context). 
In my case it was caused by a problem elsewhere - either:
a) The floating point stack is full
b) A fpu exception has been raised proviously, but is discovered in the 
round function when exceptions are unmasked

More information about the Lazarus mailing list