9 Oct 2011 05:52
trapping floating-point exceptions on Windows
Hi, I'm learning Limbo by writing toy programs. I'd like to trap FP exceptions,
which would seem to be possible according to Section 9.16 in _The Limbo
Programming Language_. But they aren't being trapped. Here's the source:
implement Traptest;
include "sys.m";
sys: Sys;
include "draw.m";
draw: Draw;
Traptest: module
{
init: fn(ctxt: ref Draw->Context, argv: list of string);
};
init(nil: ref Draw->Context, nil: list of string)
{
sys = load Sys Sys->PATH;
num := 1.0;
while (num > 0.0) {
{ num *= 1E50; }
exception {
* =>
sys->print("exception!\n");
num = 0.0;
}
sys->print("%g\n", num);
}
(Continue reading)
On Wed, 12 Oct 2011 15:37:47 +0400, Sergey Zhilkin
<
RSS Feed