My comments Marcin 'Qrczak' Kowalczyk (19 Oct 2005 18:37 UTC)
Re: My comments Bradd W. Szonye (19 Oct 2005 19:17 UTC)
Re: My comments Thomas Bushnell BSG (19 Oct 2005 19:44 UTC)
Re: My comments Bradd W. Szonye (19 Oct 2005 19:55 UTC)
Re: My comments Thomas Bushnell BSG (19 Oct 2005 20:11 UTC)
Re: My comments John.Cowan (19 Oct 2005 20:10 UTC)
Re: My comments Thomas Bushnell BSG (19 Oct 2005 20:13 UTC)
Re: My comments Bradd W. Szonye (19 Oct 2005 20:25 UTC)
Re: My comments Marcin 'Qrczak' Kowalczyk (19 Oct 2005 20:23 UTC)
Re: My comments Bradd W. Szonye (19 Oct 2005 20:36 UTC)
Re: My comments Marcin 'Qrczak' Kowalczyk (19 Oct 2005 21:36 UTC)
Re: My comments Bradd W. Szonye (19 Oct 2005 21:42 UTC)
Re: My comments Bradd W. Szonye (19 Oct 2005 22:08 UTC)
Exactness (was Re: My comments) bear (20 Oct 2005 01:50 UTC)
Re: Exactness Thomas Bushnell BSG (20 Oct 2005 03:45 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (20 Oct 2005 09:13 UTC)
Re: Exactness Bradd W. Szonye (20 Oct 2005 20:15 UTC)
Re: Exactness bear (20 Oct 2005 22:09 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (21 Oct 2005 02:08 UTC)
Re: Exactness Thomas Bushnell BSG (21 Oct 2005 03:05 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (21 Oct 2005 08:15 UTC)
Re: Exactness Thomas Bushnell BSG (21 Oct 2005 18:38 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (21 Oct 2005 20:12 UTC)
Re: Exactness Thomas Bushnell BSG (21 Oct 2005 20:29 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (21 Oct 2005 20:38 UTC)
Re: Exactness Thomas Bushnell BSG (21 Oct 2005 20:44 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (21 Oct 2005 21:20 UTC)
Re: Exactness Thomas Bushnell BSG (21 Oct 2005 21:44 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (21 Oct 2005 22:18 UTC)
Re: Exactness Thomas Bushnell BSG (21 Oct 2005 22:48 UTC)
Re: Exactness Marcin 'Qrczak' Kowalczyk (22 Oct 2005 00:34 UTC)
Re: Exactness Thomas Bushnell BSG (22 Oct 2005 01:02 UTC)
Re: Exactness Per Bothner (22 Oct 2005 00:59 UTC)

Re: Exactness Thomas Bushnell BSG 21 Oct 2005 22:48 UTC

Marcin 'Qrczak' Kowalczyk <xxxxxx@knm.org.pl> writes:

> I want to make more predictable when the programmer will obtain a
> ratnum and when a flonum. And I want him to be sure that he will not
> obtain some weird representation like "a ratnum with inexactness bit"
> or "fixed-size decimal fraction" without explicitly asking for it.

How about providing arithmetic functions that provide those guarantees
then?

You're approach has been to have programmers ask for a particular
*implementation*.  This is not the scheme way, and it's a bad way to
think about programming in general.  Much better is to think about
what *features* specifically you want, and have programmers ask for
*those*.  It is in that sense that I say that Scheme does not have a
"flonum".

So far you've mentioned one feature: constant size arithmetic.  I've
suggested one way of having programmers ask for that feature (though
there are surely others).

>> See, this is where you're wrong.  Constant-width addition is valuable
>> for integers too, not just floats.  But when people doing integer
>> arithmetic want that, it's an "efficiency hack", and when you want it
>> for floating point, it's Absolutely Essential.
>
> What do you mean by constant-width addition?

I mean "addition in which the space use of the output is no larger
than the input".  This is a feature which you said was needed for
reals (I agree) and it's a feature that is useful for integers too.

> Fixed-size floating point arithmetic differs in that it's safe, that
> people expect it to be slightly inexact (or should be taught to expect
> this), and that often the performance difference between fixed size
> floating point and exact ratios is huge, while the difference in the
> answer is small.

I don't know what you mean by "safe"; there are legions of programmers
making bad mistakes because of the unobvious intricacies of the way
that floating point simulates well understood mathematical
operations.

> Of course the programmer can use exact ratios instead if he chooses.
> It should be his choice, not the Scheme implementor's choice.

But it already is!  I'm baffled by what you're asking here; the
feature you seem to be requesting (though I can't tell for sure) is
now that you want a way for programmers to specify whether they want
exact or inexact numbers.  Of course, Scheme provides that already.

> Letting (+ 1.2 3.4) perform fixed-size binary floating point arithmetic
> is compatible with both the existing standard and common practice.

What exactly are you asking for?  Perhaps I'm misunderstanding.

By "letting" do you mean "requiring"?  (Because then, you're wrong.)