[racket] Question about round
Another such annoyance is than (min 1 +inf.0) => 1.0 - because if any
argument is inexact, the result is inexact. I don't think this makes sense
in the case of infinities. Infinities are very useful as initial values for
things that are being minimized or maximized, but there is always the need
for inexact->exact to protect against the (unexpected) coercion.
This is all from the original R5RS and continued in R6RS - but, we aren't
that language.
Could we get an exception to the coercions in the case of +/-inf.0? Or an
alternative min/max that don't do it?
On Fri, Sep 30, 2011 at 6:53 AM, Matthias Felleisen <matthias at ccs.neu.edu>wrote:
>
> exact-round is preferred.
>
>
>
> On Sep 30, 2011, at 8:51 AM, Eli Barzilay wrote:
>
> > Yesterday, Ryan Culpepper wrote:
> >> The pragmatic answer is you generally have to write
> >>
> >> (inexact->exact (round x))
> >>
> >> which is annoying, but no one has yet bothered to add a standard
> >> library function for this, as far as I know.
> >
> > [From the annoyed side, especially since that thing tends to come in
> > bunches which can make some quick code look much heavier than it is:]
> >
> > Maybe it's time to add something for that? `eround'? (But even
> > `exact-round' would be better than the above.)
> >
> > --
> > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
> > http://barzilay.org/ Maze is Life!
> > _________________________________________________
> > For list-related administrative tasks:
> > http://lists.racket-lang.org/listinfo/users
>
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110930/20a7a801/attachment.html>