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

(declare (type fixnum ---)) considered etc.

    Date: Wed, 23 Jul 86 14:54 EDT
    From: Daniel L. Weinreb <DLW@QUABBIN.SCRC.Symbolics.COM>

	Date: Wed, 23 Jul 86 12:42 EDT
	From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>

	    Date: Wed, 23 Jul 1986  10:39 EDT
	    From: Rob MacLachlan <RAM@C.CS.CMU.EDU>

	    It seems that FIXNUM is no less portable than FLOAT, since nothing is
	    guaranteed about float exponent range and precision.  A Common Lisp
	    program which uses floats cannot be totally portable.  One could take
	    this as an argument against the currently system of float types, but
	    I don't have a better solution.

Aha!  What you want is for type FLOAT to take precision and exponent
size arguments.  So IEEE single-float would be (FLOAT-BINARY 24 8).  We
could accept (FLOAT-DECIMAL 6 2) for those who think in base 10.  )Well,
yes as a matter of fact, I did once write a PL/I program. :-(

Then you could write completely portable programs, modulo the completely
unportable ideas of rounding, size of intermediate results, etc.  I
understand that there is no such thing as a completely portable
floating-point program, but this would be a step in the right direction.

Then we could move SINGLE-FLOAT, etc. to SYS: along with FIXNUM and
everyone would be happy.

(For this to become a real proposal, someone will have to figure out a
new reader syntax for floating-point constants.  The current s/f/d/l
exponent mark hack depends on the current set of types.)

	Good point.  The difference with fixnums is that they are (a) exact and
	(b) have overflow provision (into bignums).

    All this means to me is that FLOAT is wrong as well.  Table 2-1, page
    17, specifies "recommended" minimum sizes for the floating types.  I
    originally argued that these should be required minimum sizes, for
    exactly the reasons we're discussing here, and I still think they should
    be.  A "recommendation" is meaningless if you are trying to write code
    and feel secure that it will run in other implementations of CL.