Skip to content

Commit

Permalink
Added necessary instances for math.h functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
leepike committed Sep 23, 2010
1 parent 2dc4ddf commit baad330
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Language/Atom/Expressions.hs
Expand Up @@ -525,7 +525,8 @@ instance (OrdE a, NumE a, Num a, Fractional a) => Fractional (E a) where
recip a = 1 / a
fromRational r = Const $ fromInteger (numerator r) / fromInteger (denominator r)

{-
-- make typed Atom expressions an instance of Floating
-- to generate calls to functions in math.h
instance (Num a, Fractional a, Floating a, FloatingE a) => Floating (E a) where
pi = Const pi
exp (Const a) = Const $ exp a
Expand All @@ -548,7 +549,6 @@ instance (Num a, Fractional a, Floating a, FloatingE a) => Floating (E a) where
asinh a = log (a + sqrt (a ** 2 + 1))
acosh a = log (a + sqrt (a ** 2 - 1))
atanh a = 0.5 * log ((1 + a) / (1 - a))
-}

instance (Expr a, OrdE a, EqE a, IntegralE a, Bits a) => Bits (E a) where
(Const a) .&. (Const b) = Const $ a .&. b
Expand Down

0 comments on commit baad330

Please sign in to comment.