okuoku / yuni

R7RS/R6RS/Generic Scheme portability platform
Other
32 stars 3 forks source link

`(abs -0.0)` yields `-0.0` on several implementations #173

Open okuoku opened 2 years ago

okuoku commented 2 years ago

As mentioned in SIBR0013 document, several implementations return minus value with abs if argument was -0.0.

    # (abs -0.0) => -0.0
    inexact3-CHIBI_SCHEME
    inexact3-DIGAMMA
    inexact3-FOMENT
    inexact3-KAWA
    inexact3-STKLOS

Even on these implementations, (atan -0.0 1.0) is -0.0 thus we know they can handle -0.0 during computation.

It might be better to check truncation as well: https://github.com/shirok/Gauche/commit/ca136f159390556a2b34dabf279ced88ab6edc89#diff-84296dbbce35929ab06ca6deb1cac5abde4d8a0f896b2657491432061ca92e37R1839-R1841