Permalink
Browse files

Make this per au instuctions:

00:11 <au> I see. it can be fixed in Pugs/Prim/Numeric.hs
00:11 <au> in op2Exp to do a (^) instead of a (^^) if the right hand side is non-negative
  • Loading branch information...
1 parent b1c99f1 commit 28665503b08b572f0d7c5bad8e5f897e78c48511 @ingydotnet ingydotnet committed Oct 11, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 Pugs/src/Pugs/Prim/Numeric.hs
@@ -124,7 +124,10 @@ op2Exp x y = do
('0':'.':_) -> do
num1 <- fromVal =<< fromVal' x
if isDigit . head $ show (num1 :: VNum)
- then op2Rat ((^^) :: VRat -> VInt -> VRat) x y
+ then do
+ if num2 >= 0
+ then op2Rat ((^) :: VRat -> VInt -> VRat) x y
+ else op2Rat ((^^) :: VRat -> VInt -> VRat) x y
else op2Floating (**) x y
_ -> op2Floating (**) x y

0 comments on commit 2866550

Please sign in to comment.