Skip to content

Commit

Permalink
Fixed pow giving undefined with lhs < 0 and rhs < 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bakk committed May 26, 2021
1 parent a15d7b3 commit a411b13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kalk/src/kalk_num/regular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion kalk/src/kalk_num/with_rug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a411b13

Please sign in to comment.