Wamberto Vasconcelos escreveu:
Folks
One of my students drew my attention to the following unexpected
result from CIAO:
?- X is 1926/100.
X = 19.2600000000000029 ?
Why is the "29" appearing at the end? Is this only happening in our
current version?
The result is not "bizarre" but a consequence of the way floating point
numbers are represented in computers.
The default number of digits chosen for the current version of Ciao (in
our installation 1.8) lets us see the 'imprecision'. Probably there
should be a means of reducing the number of figures to four or five
where you would get a more 'expected' result.
HTH
--
Cesar Rabak
GNU/Linux User 52247.
Get counted:
http://counter.li.org/
==============================================================================
Message: Address: Action:
help majordomo(a)clip.dia.fi.upm.es Info. on useful commands
subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list
unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list
<whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
-----------------------------------------------------------------------------
Archived messages:
http://www.clip.dia.fi.upm.es/Mail/ciao-users/
-----------------------------------------------------------------------------