From aac80f0c3c2d414e999ffb291dc0ec560aad7ab3 Mon Sep 17 00:00:00 2001 From: axexlck Date: Wed, 9 Dec 2020 18:26:53 +0100 Subject: [PATCH] #207 - Fix error in Power#e2ApfloatArg() method numerical high precision evaluation - https://github.com/axkr/symja_android_library/discussions/206 --- .../main/java/org/matheclipse/core/builtin/Arithmetic.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/Arithmetic.java b/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/Arithmetic.java index 78f97854fc..30ec9c3d8d 100644 --- a/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/Arithmetic.java +++ b/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/Arithmetic.java @@ -3453,6 +3453,11 @@ private static IExpr e2ApcomplexArg(final ApcomplexNum base, final ApcomplexNum } private static IExpr e2ApfloatArg(final ApfloatNum base, final ApfloatNum exponent) { + if (exponent.sign() < 0) { + ApcomplexNum b=base.apcomplexNumValue(base.precision()); + ApcomplexNum e=exponent.apcomplexNumValue(base.precision()); + return b.pow(e); + } return base.pow(exponent); }