From d14608003478010b1725207e2198f8513e86351e Mon Sep 17 00:00:00 2001 From: Dominic Orchard Date: Mon, 16 Sep 2024 14:14:45 +0100 Subject: [PATCH] generalise exponent handling --- src/Language/Fortran/Repr/Eval/Value.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Language/Fortran/Repr/Eval/Value.hs b/src/Language/Fortran/Repr/Eval/Value.hs index 4620ed9d..09bfa0b1 100644 --- a/src/Language/Fortran/Repr/Eval/Value.hs +++ b/src/Language/Fortran/Repr/Eval/Value.hs @@ -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 + _ -> err $ ELazy "exponentiation: unsupported types" F.Concatenation -> case (l', r') of