[racket-dev] [racket] Question about round

From: Stephen Bloch (bloch at adelphi.edu)
Date: Fri Sep 30 16:22:14 EDT 2011

On Sep 30, 2011, at 11:59 AM, Vincent St-Amour wrote:

> On a more general note, do we really need inexact integers?
> 
> The behavior of `integer?' is confusing

Is it MATHEMATICALLY confusing, or is it confusing because most of us were brought up (in CS) with "integer" meaning "32-bit two's-complement binary representation of an integer"?

The English language uses inexact integers all the time.  "It's about 5 miles."  "It'll take about twenty minutes."  "Set your oven to 350 degrees."  All of those are continuous physical quantities that happen to have been measured to an accuracy of 1 or more; it could actually be higher or lower by up to a mile, or several minutes, or about ten degrees, respectively.

One could even say "There are about fifty students in the class."  In this case, I am 100% sure that the number of students is an integer, but less than 100% sure that that integer is 50.  How would you represent this number?  If you say it's not an integer because it's not exact, you've allowed for fractional students.  If you say it must be exact because it's an integer, you've pretended to greater confidence than is justified.



Stephen Bloch
sbloch at adelphi.edu




Posted on the dev mailing list.