: Jos Koot
Cc: Mark Engelberg; Stephen Bloch; users@racket-lang.org
Subject: Re: [racket] Question about round
I was only advocating it in the case of infinities. The R(5,6)RS
documentation for min/max says: "If any argument is inexact, then the result
is also inexact (unless the procedur
*On Behalf Of *Mark Engelberg
> *Sent:* viernes, 30 de septiembre de 2011 18:18
> *To:* Stephen Bloch
> *Cc:* users@racket-lang.org
> *Subject:* Re: [racket] Question about round
>
> I'm amazed at how long I've gone with the misconception that:
> Exact Numbers = Int
racket] Question about round
I'm amazed at how long I've gone with the misconception that:
Exact Numbers = Integers union Rationals
Inexact Numbers = Floating Point numbers
(Frankly, I never really thought much about what infinities were. I assumed
they were a separate, distinct type).
W
On Sep 30, 2011, at 12:31 PM, Robby Findler wrote:
> Just to clear up one more possible point: the rational? predicate
> actually recognizes inexact numbers, eg:
>
> [robby@penghu] ~/git/plt/collects/drracket/private$ racket
> Welcome to Racket v5.1.3.9.
>> (rational? (sqrt 2))
> #t
Interesting
Just to clear up one more possible point: the rational? predicate
actually recognizes inexact numbers, eg:
[robby@penghu] ~/git/plt/collects/drracket/private$ racket
Welcome to Racket v5.1.3.9.
> (rational? (sqrt 2))
#t
Robby
On Fri, Sep 30, 2011 at 11:18 AM, Mark Engelberg
wrote:
> I'm amazed
I'm amazed at how long I've gone with the misconception that:
Exact Numbers = Integers union Rationals
Inexact Numbers = Floating Point numbers
(Frankly, I never really thought much about what infinities were. I assumed
they were a separate, distinct type).
When I saw in the docs for round that i
At Fri, 30 Sep 2011 09:25:50 -0400,
Eli Barzilay wrote:
> > Could we get an exception to the coercions in the case of +/-inf.0?
> > Or an alternative min/max that don't do it?
>
> My guess is that changes in this area are hopeless, since they'll
> break a bunch of code in unexpected ways. (Not to
Agreed in general, but I think we want an exact positive and negative
infinity, not more confusion to the coercion rules. Ironically R6RS
includes max and min integers (at least I have a vague memory of such
an addition) which will do the job.
N.
On Fri, Sep 30, 2011 at 2:16 PM, Doug Williams
w
A few minutes ago, Doug Williams wrote:
> 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 minimize
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
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
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 t
ket-lang.org
Subject: [racket] Question about round
I'm a bit baffled by this behavior:
> (exact? (round (sin 30)))
#f
> (integer? (round (sin 30)))
#t
>
How is it possible to have an inexact integer?
I would expect the answer to both of these tests
On Sep 29, 2011, at 5:11 PM, Mark Engelberg wrote:
> How is it possible to have an inexact integer?
That threw me, too, the first time I encountered it.
Where do inexact numbers come from? Two common sources: physical measurement,
and computations whose exact results can't be represented in a
On 09/29/2011 03:11 PM, Mark Engelberg wrote:
I'm a bit baffled by this behavior:
> (exact? (round (sin 30)))
#f
> (integer? (round (sin 30)))
#t
>
How is it possible to have an inexact integer?
> (inexact? 1.0)
#t
The interpretation of "inexact" is subtle and contentious. But to a
first
#i42 is an inexact integer, there's noting notable about them.
43.0 is another one.
Cheers
2011/9/29, Mark Engelberg :
> I'm a bit baffled by this behavior:
>
>> (exact? (round (sin 30)))
> #f
>> (integer? (round (sin 30)))
> #t
>>
>
> How is it possible to have an inexact integer?
>
> I would
I'm a bit baffled by this behavior:
> (exact? (round (sin 30)))
#f
> (integer? (round (sin 30)))
#t
>
How is it possible to have an inexact integer?
I would expect the answer to both of these tests to be true.
Thanks,
Mark
_
For list-related ad
17 matches
Mail list logo