justinethier / cyclone

:cyclone: A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
http://justinethier.github.io/cyclone/
MIT License
823 stars 42 forks source link

`truncate-quotient` should return exact number where possible #519

Closed okuoku closed 7 months ago

okuoku commented 7 months ago

Tested: https://github.com/justinethier/cyclone/commit/1d775c5a752048466f19c5f3f67706bf3678a555

cyclone> (truncate-quotient 5 2)
2.0

Per R7RS, truncate-quotient should return exact result if input was exact integers. R7RS provides example as following:

(truncate/ -5 -2) => 2 -1
(truncate/ -5.0 -2) => 2.0 -1.0
justinethier commented 7 months ago

This has been fixed on master branch. Thanks for the report!