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

Re: R3RS number syntax

In article <880427-173044-6364@Xerox> Pavel.pa@XEROX.COM writes:

>2.  What is the meaning of the exponent part when the radix is not 10?  My guess
>was that ``#O3E4'' meant 3 times 8 to the 4th,

	Mine, too.  I always thought of exponents as being merely a
    notational convenience for inconveniently-placed radix points.

>4.  Does ``123##.##'' mean anything different from ``12300'' when read?  Or does
>it really mean the same as ``#i12300''?

	I think the system should try to arrange that when it reads
    (and evals) something that it printed out, the object created
    should be as indistinguishable as possible from the one printed.
    (This is of course an impossible goal, if only because you can
    always print a number with fewer digits of precision than are
    implicit in its internal representation; or because you can
    print an inexact "1" as an integer with exactness surpressed.)
    I also think the purpose of the "exact" bit is very low-level;
    I believe it is intended to flag that all information necessary
    to describe a number completely is contained in the particular
    bit-pattern that represents the number in store.
	If that is true, then the system should NEVER print "#"s
    in any representation of an exact number.  Thus for example,
    if you asked for the exact rational 1/3 to be printed as a
    decimal with six million digits of precision, you should get
    lots and lots of "3"s, even though no likely internal
    representation of a flonum has that much precision.
	So if the system prints "123##.##", the number printed
    must originally have been inexact.  Thus I think the reader
    ought to treat "123##.##" as an inexact number.
	Don't take me as an authority, I certainly am not!

	It seems more natural to me to interpret 3/4e6 as (3/4)e6,
    but I certainly don't see anything in the R3 report to require it.

    By the way, what does C-Scheme say to "(integer?  1.0)"?  To "(integer?
1)"?  MacScheme (version 1.51) says the former is false and the latter true;
I think both should be true.  (MacScheme does say that "(= 1 1.0)" is true
so I am not just a victim of roundoff.)

					-- Jay Freeman

<canonical disclaimer -- these are personal opinions only>