[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0

Alex Shinn <alexshinn@x> writes:

> The result you're seeing is because make-rectangular
> is defined:
>   (define (make-rectangular x y)
>     (+ x (* y (sqrt -1))))
> in order to keep the number of primitives to a minimum,
> and the sign on the zero gets lost in the arithmetic.

In that case, the bug is in 'make-rectangular'.

> The standard is silent on whether or not this is allowed
> for make-rectangular,

The R7RS-draft-8 states in the definition of 'make-rectangular':

  Then all of:
     (make-rectangular x_1 x_2) => z
     (real-part z) => x_1
     (imag-part z) => x_2
  are true, [...]

> but note in Chibi the value -0.0 is
> only supported as a place holder and in the future will
> be removed in favor of not underflowing.

Okay.  IMO, it's unwise to allow inexacts to use unbounded amounts of
memory and computation time, and I could easily construct example
computations that work well on most implementations but that slow down
to a crawl and/or run out of memory in your proposed representation, but
Chibi is your baby and that's your choice.

In the meantime, Chibi is not conformant to the requirements of
R7RS-draft-8 in this respect.


Scheme-reports mailing list