Re: SRFI 278: Supplemental Numerics
Peter McGoron 19 Jul 2026 01:56 UTC
Some announcements:
1. I have a bleeding-edge version of the SRFI repository here:
https://github.com/mcgoron-peter/srfi-278
This has a sample implementation updated to work on Gauche and
CHICKEN 6 (latest HEAD, previous CHICKEN versions have issues relating
to reading complex numbers).
2. Many implementations widen real arguments to have a +0i (or +0.0i)
imaginary part when multiplying them with complex numbers. This causes
some unfortunate issues, such as (* 1 z) and (* +i (* +i (* +i (* +i
z)))) not being the identity when passed a complex number with
infinities or NaNs. (This is related to, but distinct from, the fact
that it is unspecified whether (* 0 +inf.0) returns NaN or 0.)
My solution to this in a future draft is to spell out real-complex,
real-imaginary, and imaginary-complex arithmetic in a similar way to
Annex G of the current C standard.
<https://port70.net/~nsz/c/c23/n3220.pdf> pg. 541.
This will necessitate defining imaginary? and strictly-imaginary? as
predicates.
3. I ask anyone who has an implementation with inexact complex numbers
and the ability to support SRFI 144 (one can use the sample
implementation) to test the sample implementation. Even if you report
that it spits out nonsense, it's useful to me to try and iron out any
incompatabilities.
-- Peter McGoron