ekmett / intervals

Interval Arithmetic
http://hackage.haskell.org/package/intervals
BSD 2-Clause "Simplified" License
27 stars 13 forks source link

(**) default implementation is incorrect for negative values #50

Open alex-rozenshteyn-leapyear opened 7 years ago

alex-rozenshteyn-leapyear commented 7 years ago
> let x = (-2) in x ** x
0.25
> import Numeric.Interval.NonEmpty
> let x = (-2) ... (-2) in x ** x
Infinity ... Infinity
ekmett commented 7 years ago

Woops.

massma commented 4 years ago

Another example, but with slightly different behavior:

> ((-1.0) ... (-0.5)) ** 2.0
Empty

I'll try and poke around and zero in on the problem if I can find the time.

amigalemming commented 3 years ago

You are using the wrong power function. You must use (^^) instead.