Commit 185e65f1 authored by John's avatar John

small improvement for power of Integer

parent 8aae8fa9
Pipeline #31821 failed with stage
in 2 minutes and 17 seconds
......@@ -54,13 +54,9 @@ where
= negative_power_error
| size x.integer_a<>0 || x.integer_s < -1 || x.integer_s > 1
= abort "^ (Integer) overflow"
| x.integer_s==1
| x.integer_s== -1 && n.integer_a.[0] bitand 1==0
= one
| x.integer_s== -1
| n.integer_a.[0] bitand 1==0
= one
= ~one
= zero
= x
where
pow :: !Integer !Int -> Integer
pow a b
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment