Subject: Re: Strange result from round
From: Erik Naggum <erik@naggum.net>
Date: Fri, 05 Apr 2002 19:39:45 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3227024402097431@naggum.net>

* Kent M Pitman
| ROUND in this case is separating the 5 from the .1 but I don't think
| there is a loss of information in that particular operation; I think
| it's "exact" insofar as the inputs were exact, because there is no
| increase in magnitude that would force a loss of precision.

  Well, actually, there is.  If 5.1 and 0.1 both use n bits of precision,
  (- 5.1 5.0) actually ends up using n-3 bits of precision for the 0.1
  return value, effectively replacing the three least significant bits with
  zeros.  Since 0.1 has a bit pattern of repeating groups of 1100, losing
  the three least significant bits must lead to a value different from 0.1.

///
-- 
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.

  Post with compassion: http://home.chello.no/~xyzzy/kitten.jpg