[plt-scheme] What's the deal with inexact numbers?

From: Todd O'Bryan (toddobryan at mac.com)
Date: Mon Mar 5 17:31:14 EST 2007

I've noticed a strange inconsistency with respect to inexact numbers.

The values of e and pi in HtDP Beginning Student are accurate to 15
decimal places:

> e
#i2.718281828459045
> pi
#i3.141592653589793

But it seems that trigonometric functions are accurate to 16 decimal
places. Is this just an unintended inconsistency? How accurate should
inexact numbers be?

I also noticed the following little interesting tidbit:

> (min 2 pi)
#i2.0

I guess it makes sense, given that the two numbers have to be compared
to one another to convert them to the least exact representation, but
does anyone else get the heebie-jeebies about a minimum function
returning an element that's not in the set of things it was given to
compare?

Todd




Posted on the users mailing list.