[racket] Inconsistency of `in-range` and numerical issues

From: Hendrik Boom (hendrik at topoi.pooq.com)
Date: Wed Feb 25 08:30:02 EST 2015

On Wed, Feb 25, 2015 at 09:04:14AM +0100, Konrad Hinsen wrote:
> On 24/02/2015 23:01, Steve Graham wrote:
> 
> If anything could be (or could have been) improved in Racket, it's
> two points:
> 
>  1) read-decimal-as-inexact could be #f by default, preferring
> exactness over efficiency by default.
> 
>  2) in-range could be defined with an integer step-number argument
> rather than a float step-size.
> 

I concur.

> 
> >I gather, though, that such behavior in other languages is typical, correct?
> 
> Most languages offer IEEE 754 binary floats but not rationals nor
> decimal floats. Some languages try to hide round-off errors when
> printing results, which I think is a bad idea because it actually
> introduces a second source of error.
> 

It's very tempting in language design to solve a common problem in a 
way that leads to deep. obscure, and deadly traps elsewhhere.

There's nothing that can replace intimate understanding of one's basic 
tools.

--hendrik

Posted on the users mailing list.