[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Query about proposed slight change to FIX and FIXR functions
- To: INFO-LISPM at MIT-AI, (BUG LISP) at MIT-AI
- Subject: Query about proposed slight change to FIX and FIXR functions
- From: Moon at MIT-AI (David A. Moon)
- Date: Wed ,11 Mar 81 18:58:00 EDT
- Cc: RWG at MIT-AI
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?