marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

hypot #44

Closed barak closed 11 years ago

barak commented 11 years ago

(magnitude (make-rectangular 1e200 1e200)) overflows. This is because it directly calculates something of the form (sqrt (+ (square x) (square y))). The right way to fix this is to include hypot in the math functions imported from the math libraries, and use it appropriately. It might even be worth exposing to Scheme as its own function.

marcomaggi commented 11 years ago

I have added flhypot and changed the implementation of $magnitude-cflonum.