[Sorry for the long quote, but context is important]
Dan Piponi wrote:
It's fairly standard practice, when documenting functions of a complex
variable, to specify precisely which 'branch cuts' are being used.
Here's a quote from the Mathematica documentation describing their Log
function: "Log[z
urce,
and you'll be benefiting lots of people.
Simon
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lennart
Augustsson
Sent: 04 August 2007 16:47
To: Andrew Coppin
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] How odd...
Haskell doesn't know much about
On 5 Aug 2007, at 5:26 am, Andrew Coppin wrote:
Infinity times any positive quantity gives positive infinity.
Infinity times any negative quantity gives negative infinity.
Infinity times zero gives zero.
What's the problem?
That in IEEE arithmetic, infinity times zero is *NOT* zero.
Everythin
On 8/4/07, Stephen Forrest <[EMAIL PROTECTED]> wrote:
> Of course, taking the nth root is multi-valued, so if you're to return a
> single value, you must choose a convention. Many implementations I have
> seen choose the solution with lowest argument (i.e. the first solution
> encounted by a count
On 8/4/07, Dan Piponi <[EMAIL PROTECTED]> wrote:
>
> On 8/4/07, Albert Y. C. Lai <[EMAIL PROTECTED]> wrote:
> > There is no reason to expect complex ** to agree with real **.
>
> There's every reason. It is standard mathematical practice to embed
> the integers in the rationals in the reals in the
On 8/4/07, Albert Y. C. Lai <[EMAIL PROTECTED]> wrote:
> There is no reason to expect complex ** to agree with real **.
There's every reason. It is standard mathematical practice to embed
the integers in the rationals in the reals in the complex numbers and
it is nice to have as many functions as
Andrew Coppin wrote:
> 0^2
0
> (0 :+ 0)^2
0 :+ 0
> 0**2
0
> (0 :+ 0)**2
NaN :+ NaN
There is nothing wrong AFAIK. (How much do I know? BSc in math, went
through classes on real analysis and complex analysis.)
There is no reason to expect complex ** to agree with real **.
Real x**y is
Hi
If you just use Catch (http://www-users.cs.york.ac.uk/~ndm/catch/):
> > foo x
> >| x < 0 = ...
> >| x == 0 = ...
> >| x > 0 = ...
This gives an error. Something identical to this code is in
Data.FiniteMap, and indeed, when using floats and NaN's (or just silly
Ord classes) you ca
On Sat, Aug 04, 2007 at 04:38:08PM +0100, Andrew Coppin wrote:
>
> BTW, I recently had some code like this:
>
> foo x
>| x < 0 = ...
>| x == 0 = ...
>| x > 0 = ...
>
> I was most perplexed when I got a "non-exhaustive patterns" exception...
> It turns out there was a NaN in there.
Infinity is a very slippery concept, you can't compute with it like that.
You can compute various limits, though.
So, e.g., for a > 0
lim x*a -> Inf
x->Inf
and
lim x*0 -> 0
x->Inf
But
lim x*(1/x) -> 1
x->Inf
And that last one would be "Inf*0" in the limit. In fact, you can make
Inf*0 a
Um... why would infinity * 0 be NaN? That doesn't make sense...
Infinity times anything is Infinity. Zero times anything is zero. So
what should Infinity * zero be? There isn't one right answer. In
this case the "morally correct" answer is zero, but in other contexts
it might be Infinit
The Haskell type class RealFloat has a reasonable number of operations to
test for NaN, denormalized numbers, etc.
You can also ask if the implementation uses IEEE.
-- Lennart
On 8/4/07, Paul Johnson <[EMAIL PROTECTED]> wrote:
>
> Andrew Coppin wrote:
> > Paul Johnson wrote:
> >> > log 0
> >> -
Also see
http://hal.archives-ouvertes.fr/hal-00128124
before you start on any serious numerical software.
Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Andrew Coppin wrote:
Paul Johnson wrote:
> log 0
-Infinity
Oh. So... since when does Haskell know about infinity?
I should have mentioned that the underlying platform in my case is an
Intel P4. Haskell does not specify a floating point implementation; the
assumption is that it uses whatever t
Andrew Coppin wrote:
It's news to me that the IEEE floating point standard defines
infinity. (NaN I knew about...)
See http://en.wikipedia.org/wiki/IEEE_754
Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/li
Lennart Augustsson wrote:
Haskell doesn't know much about infinity, but Haskell implementations
are allowed to use IEEE floating point which has infinity.
And to get things right, there needs to be a few changes to the
library to do the right thing for certain numbers, this is not news.
In fac
Haskell doesn't know much about infinity, but Haskell implementations are
allowed to use IEEE floating point which has infinity.
And to get things right, there needs to be a few changes to the library to
do the right thing for certain numbers, this is not news. In fact I filed a
bug report a while
Paul Johnson wrote:
Andrew Coppin wrote:
> 0**2
0
> (0 :+ 0)**2
NaN :+ NaN
(Is this a bug?)
According to the Standard Prelude,
# x ** y = exp (log x * y)
I had a feeling this would be the cause.
> log 0
-Infinity
Oh. So... since when does Haskell know about infinity?
BTW,
Andrew Coppin wrote:
> 0**2
0
> (0 :+ 0)**2
NaN :+ NaN
(Is this a bug?)
According to the Standard Prelude,
# x ** y = exp (log x * y)
So 0 ** 2 is equivalent to exp (log 0 * 2)
> log 0
-Infinity
> log 0 * 2
-Infinity
> exp (log 0 * 2)
0.0
On to the complex number case. From
19 matches
Mail list logo