diff --git a/src/libasr/runtime/lfortran_intrinsics.c b/src/libasr/runtime/lfortran_intrinsics.c index 8f272a02be..2815cb715e 100644 --- a/src/libasr/runtime/lfortran_intrinsics.c +++ b/src/libasr/runtime/lfortran_intrinsics.c @@ -281,6 +281,11 @@ LFORTRAN_API double _lfortran_dexp(double x) return exp(x); } +LFORTRAN_API double _lfortran_dexp2(double x) +{ + return exp2(x); +} + LFORTRAN_API float_complex_t _lfortran_cexp(float_complex_t x) { return cexpf(x); diff --git a/src/runtime/math.py b/src/runtime/math.py index 587c727a02..7bfad62c86 100644 --- a/src/runtime/math.py +++ b/src/runtime/math.py @@ -463,13 +463,21 @@ def exp(x: f64) -> f64: """ Return `e` raised to the power `x`. """ - return e**x + return _lfortran_dexp(x) + +@ccall +def _lfortran_dexp(x: f64) -> f64: + pass def exp2(x: f64) -> f64: """ Return `2` raised to the power `x`. """ - return f64((2.0)**x) + return _lfortran_dexp2(x) + +@ccall +def _lfortran_dexp2(x: f64) -> f64: + pass def mod(a: i32, b: i32) -> i32: