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

Re: float numbers




	Date: Wed, 27 Jan 88 15:40:46 CST
	From: chou%mcc.com%mcc.com%sally.utexas.edu@RELAY.CS.NET Chou <chou@mcc.com>
	To: kcl@rascal.ics.utexas.edu
	Subject: float numbers
	Cc: ballou@mcc.com
	
	
	It appears that KCL compiler is not handling (generating)
	floating numbers properly.
	The following script indicates that KCL compiler always 
	converts a floating point number to long-float, even when 
	the program explicitly specified short-float.
	
	Hong-Tai Chou, MCC
	
	-------------------------------------------------------
	>(defun foo () 2.0S0)FOO
	>
	(type-of (foo))SHORT-FLOAT
	>
	(compile 'foo)End of Pass 1.  
	End of Pass 2.  
	OPTIMIZE levels: Safety=2, Space=2, Speed=3
	FOO
	>
	>
	(type-of (foo))LONG-FLOAT
	-------------------------------------------------------
	
I wonder if this is a real log.  I agree there is a problem, but
as far as I know, the problem occurs only if

  1. the float you used is of the sort specified by *read-default-
     float-format* at compile time, and
  2. you changed the value of *read-default-float-format* before
     loading the compiled code.

Thus, as long as you always set a same value to *read-default-
float-format*, I think you do not need worry about the problem.

	p.s.
	What we really wants is to change the default float format 
	to short-float (or equate single-float to short-float).
	Representing small numbers, such as 1.0, as double precision 
	floating numbers is quite inefficient for our system.
	We would appreciate any suggestion to get around that problem.
	Thanks!
	
Any way, since there IS a problem, I think I should fix it.
Thank you very much for the report.

-- Taiichi