mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-31 08:59:15 +01:00
Fixed pow giving undefined with lhs < 0 and rhs < 1
This commit is contained in:
parent
a15d7b37fe
commit
a411b131bb
@ -107,7 +107,7 @@ impl KalkNum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn pow_without_unit(self, rhs: KalkNum) -> 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 a = self.value.clone();
|
||||||
let b = self.imaginary_value.clone();
|
let b = self.imaginary_value.clone();
|
||||||
let c = rhs.value;
|
let c = rhs.value;
|
||||||
|
@ -65,7 +65,7 @@ impl KalkNum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn pow_without_unit(self, rhs: KalkNum) -> 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 a = self.value.clone();
|
||||||
let b = self.imaginary_value.clone();
|
let b = self.imaginary_value.clone();
|
||||||
let c = rhs.value;
|
let c = rhs.value;
|
||||||
|
Loading…
Reference in New Issue
Block a user