[R6RS] fixnum operators and overflow detection
William D Clinger
will at ccs.neu.edu
Thu Apr 13 17:11:16 EDT 2006
I have run into some issues while revising the arithmetic
SRFI.
First of all, I'd like to use div0, mod0, and div0+mod0
instead of div2, mod2, and div2+mod2 as names for the
procedures that use remainders centered around 0. I find
the 0 more mnemonic than the 2's complement association,
and I know of several programs where div2 is a name for
dividing by two. Please express an opinion if you like.
Secondly, another naming issue: We have agreed to use
names like fixnum+ for fixnum operations that wrap,
and fx+ for fixnum operations that signal an error on
overflow. What about operations that can't possibly
overflow? Should we have fixnum<, or fx<, or both?
Most importantly, I'd like to know the rationale for
restricting the domains of fx+/carry, fx-/carry, and
fx*/carry to non-negative fixnums, and for requiring
them to return non-negative fixnums as results. That
surrenders one bit of precision for no purpose that I
can see, and also makes them less generally useful.
Will
More information about the R6RS
mailing list