2 <title>Floating-point exception handler test
</title>
3 <script type=
"application/javascript" src=
"/MochiKit/packed.js"></script>
4 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <body onload=
"runTest()">
7 <embed id=
"plugin1" type=
"application/x-test" width=
"400" height=
"400"></embed>
9 <script class=
"testbody" type=
"application/javascript">
10 SimpleTest.waitForExplicitFinish();
12 function doDiv(x, y) {
16 for (i =
0 + x; i <
1000; ++i)
25 ok(isNaN(doDiv(
0.0,
0.0)),
"Undefined division-by-zero doesn't crash");
28 document.getElementById('plugin1').enableFPExceptions();
31 ok(true,
"No special code to set the FPU bit in the testplugin.");
36 ok(isNaN(doDiv(
0.0,
0.0)),
"Undefined division-by-zero doesn't crash again.");