[r6rs-discuss] Why are fx+ and fx* restricted to two arguments
Mikael Tillenius
mti at tillenius.com
Sun Feb 18 07:40:47 EST 2007
In section 9.1 fx+ and fx* are defined as taking exactly two arguments
with the following comment:
"Rationale: These procedures are restricted to two arguments
because their generalizations to three or more arguments would
require precision proportional to the number of arguments."
I still don't understand why. The programmer must make sure that no
overflow happens (or be prepared to handle the overflow) independent of
the number of arguments. Two arguments may overflow as well as ten.
I can see many reasons for having more than two arguments. E.g (define
(intensity r g b) (fxdiv (fx+ r g b) 3)) when I know all of the
arguments are between 0 and 255.
Can someone enlighten me?
/Mikael
More information about the r6rs-discuss
mailing list