Skip to content

Commit

Permalink
generalise exponent handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dorchard committed Sep 16, 2024
1 parent 21c4eed commit d146080
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Language/Fortran/Repr/Eval/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ evalBOp bop l r = do
case (l', r') of
(FSVInt li, FSVInt ri) ->
pure $ MkFScalarValue $ FSVInt $ fIntBOpInplace (^) li ri
(FSVReal lr, FSVReal ri) ->
pure $ MkFScalarValue $ FSVReal $ fRealBOpInplace' exp exp lr ri
where
exp x y = x ** y

Check warning on line 278 in src/Language/Fortran/Repr/Eval/Value.hs

View workflow job for this annotation

GitHub Actions / Ubuntu / GHC 9.2, Cabal / test

This binding for ‘exp’ shadows the existing binding

Check warning on line 278 in src/Language/Fortran/Repr/Eval/Value.hs

View workflow job for this annotation

GitHub Actions / Ubuntu / GHC 9.0, Cabal / test

This binding for ‘exp’ shadows the existing binding

Check warning on line 278 in src/Language/Fortran/Repr/Eval/Value.hs

View workflow job for this annotation

GitHub Actions / Ubuntu / GHC 9.4, Cabal / test

This binding for ‘exp’ shadows the existing binding
_ -> err $ ELazy "exponentiation: unsupported types"

F.Concatenation ->
case (l', r') of
Expand Down

0 comments on commit d146080

Please sign in to comment.