Fixed pow giving undefined with lhs < 0 and rhs < 1

This commit is contained in:
bakk 2021-05-26 22:13:58 +02:00
parent a15d7b37fe
commit a411b131bb
2 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ impl KalkNum {
}
pub(crate) fn pow_without_unit(self, rhs: KalkNum) -> KalkNum {
if self.has_imaginary() || rhs.has_imaginary() {
if self.has_imaginary() || rhs.has_imaginary() || (self.value < 0f64 && rhs.value < 1f64) {
let a = self.value.clone();
let b = self.imaginary_value.clone();
let c = rhs.value;

View File

@ -65,7 +65,7 @@ impl KalkNum {
}
pub(crate) fn pow_without_unit(self, rhs: KalkNum) -> KalkNum {
if self.has_imaginary() || rhs.has_imaginary() {
if self.has_imaginary() || rhs.has_imaginary() || (self.value < 0f64 && rhs.value < 1f64) {
let a = self.value.clone();
let b = self.imaginary_value.clone();
let c = rhs.value;