April 22, 2002
More Than Zero Point Zero

Toomas Altosaar posts a dangerous little function to info-mcl:

  Even more disconcerting is when 0.0 stops being 0.0. Here is a
  compact (and faulty) example of how to change the value behind 0.0
  using "standard Lisp code" in MCL:

  (defun increment-0.0 (value)
     (let ((sum 0.0))
       (declare (dynamic-extent sum))
       (incf sum value)))

  (increment-0.0 5.0)

  and now if you eval 0.0 you get 5.0

  0.0 => 5.0

  and it's time to reboot.

P.S. Lemonodor.com is operating in reduced-functionality mode for a bit. Mostly this means I won't be posting anything, and the comments links don't work. You can still read the comments by following the timestamp/permalink link at the end of each entry (except for this entry, because... it's not a real entry).

Posted by jjwiseman at April 22, 2002 11:39 AM
Post a comment

Email Address:


Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)


Remember info?