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

Query about proposed slight change to FIX and FIXR functions

While editing the manual, I noticed that the FIX and FIXR functions round
in a ridiculous fashion.  FIX truncates towards negative infinity,
rather than towards zero (i.e. (FIX -1.5) is -2 rather than -1).  This may
be hard to change since this function exists in Maclisp and its functionality
may be dictated by the way particular pdp-10 instructions work.  FIXR adds
0.5 and then does FIX.  (FIXR does not exist in Maclisp.)

I would like to propose that FIX be changed to truncate towards zero rather
than negative infinity, and that FIXR be changed to round stably as all the
rest of the floating-point operations do.  To elucidate:
	Operation	Now yields	Proposed to yield
	(fixr 1.5)	2		2
	(fixr 2.5)	3		2
	(fixr -1.5)	-1		-2
	(fixr -2.5)	-2		-2
	(fix -1.5)	-2		-1

Any comments?  Change FIXR but not FIX?