[R6RS] Arithmetic nitpicks

Michael Sperber sperber at informatik.uni-tuebingen.de
Sun Jul 9 05:17:55 EDT 2006


Two minor points, mainly for Will:

- Given the naming of procedures like `exact-length', shouldn't
  `exact-integer-sqrt' be called `exact-sqrt'?

- `exact-length' differs from Common Lisp's `integer-length' on
  negative arguments.  Is this intentional?

  The semantics of both don't make much sense to me: Common Lisp has
  (integer-length -8) => 3 for no good reason I can see, even though
  the two's complement representation of -8 requires 4 bits.  We have
  (exact-length -8) => 4, but also (exact-length -9) => 4, even though
  the two's complement representation of -9 requires 5 bits.  (At
  least CL's notion increments at the right point.)  Shouldn't we
  have:

  (exact-length i) => (exact-length (exact-not i)) for i < 0

  rather than

  (exact-length i) => (exact-length (exact- i)) for i < 0

  ?

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the R6RS mailing list