JeffBezanson / femtolisp

a lightweight, robust, scheme-like lisp implementation
BSD 3-Clause "New" or "Revised" License
1.58k stars 119 forks source link

Fix * and + to return inexact when given inexact args. #49

Closed dcurrie closed 7 years ago

dcurrie commented 7 years ago

These added unit tests did not pass, but do with the patch:

(assert (equal? 0.0 (+ 0.0 0))) ; tests that + no longer does inexact->exact

(assert (equal? 1.0 (* 1.0 1))) ; tests that * no longer does inexact->exact
JeffBezanson commented 7 years ago

Thanks!