<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/10/2013 10:27 PM, Marc Feeley
      wrote:<br>
    </div>
    <blockquote
      cite="mid:0F14DDA6-9976-497D-BEA2-DFE726F8FED2@iro.umontreal.ca"
      type="cite">
      <pre wrap="">
Moreover, it is important to check that the primitive functions raise exceptions correctly.  To give you an idea I have added unit tests for fx+ and fl+.  Here's the unit test for fx+:


(check-exn type-exception? (lambda () (fx+ 1/2)))
(check-exn type-exception? (lambda () (fx+ 1/2 9)))
(check-exn type-exception? (lambda () (fx+ 9 1/2)))
(check-exn type-exception? (lambda () (fx+ 1/2 3 9)))
(check-exn type-exception? (lambda () (fx+ 3 1/2 9)))
(check-exn type-exception? (lambda () (fx+ 3 9 1/2)))

(check-exn fixnum-overflow-exception? (lambda () (fx+ ##max-fixnum 1)))
(check-exn fixnum-overflow-exception? (lambda () (fx+ ##min-fixnum -1)))
</pre>
    </blockquote>
    <br>
    How would one deal with this situation:<br>
    <br>
    <blockquote><tt>firefly:~/programs/gambit/marc/gambit> gsi</tt><tt><br>
      </tt><tt>Gambit v4.7.1</tt><tt><br>
      </tt><tt><br>
      </tt><tt>> (atan +i)</tt><tt><br>
      </tt><tt>*** ERROR IN (<a class="moz-txt-link-abbreviated" href="mailto:console)@1.1">console)@1.1</a> -- (Argument 1) Out of range</tt><tt><br>
      </tt><tt>(atan +i)</tt><tt><br>
      </tt><tt>1> </tt><tt><br>
      </tt><tt>> (atan -i)</tt><tt><br>
      </tt><tt>*** ERROR IN ##atan -- (Argument 1) Out of range</tt><tt><br>
      </tt><tt>(log 0)</tt><tt><br>
      </tt><tt>1> </tt><br>
    </blockquote>
    <br>
    where an "Out of range" exception is raised, but for the wrong
    function.<br>
    <br>
    Brad<br>
  </body>
</html>