From 4283eb7e32729782cddea70973824562acaaedfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 7 Jan 2019 13:48:04 +0100 Subject: [PATCH] [poincare] Power: fix approximation 0^0 should be equal to undef --- poincare/src/power.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index e3a397372..6b3c37a4b 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -100,7 +100,7 @@ bool PowerNode::isReal(Context & context) const { template Complex PowerNode::compute(const std::complex c, const std::complex d) { std::complex result; - if (c.imag() == 0.0 && d.imag() == 0.0 && (c.real() > 0.0 || std::round(d.real()) == d.real())) { + if (c.imag() == 0.0 && d.imag() == 0.0 && c.real() != 0.0 && (c.real() > 0.0 || std::round(d.real()) == d.real())) { /* pow: (R+, R) -> R+ (2^1.3 ~ 2.46) * pow: (R-, N) -> R+ ((-2)^3 = -8) * In these cases we rather use std::pow(double, double) because: