mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-25 04:01:51 +02:00
Fixed regular.rs compilation errors
This commit is contained in:
parent
28f87f4708
commit
c5f99a8343
@ -88,7 +88,7 @@ macro_rules! as_number_or_return {
|
|||||||
if let KalkValue::Number(real, imaginary, unit) = $x {
|
if let KalkValue::Number(real, imaginary, unit) = $x {
|
||||||
(
|
(
|
||||||
real,
|
real,
|
||||||
if imaginary == -0 {
|
if imaginary == -0f64 {
|
||||||
float!(0)
|
float!(0)
|
||||||
} else {
|
} else {
|
||||||
imaginary
|
imaginary
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
pub mod special_funcs {
|
pub mod special_funcs {
|
||||||
use crate::{as_number_or_return, float, kalk_num::KalkValue};
|
use crate::{as_number_or_return, float, kalk_value::KalkValue};
|
||||||
|
|
||||||
pub fn factorial(x: KalkValue) -> KalkValue {
|
pub fn factorial(x: KalkValue) -> KalkValue {
|
||||||
let (real, _, unit) = as_number_or_return!(x);
|
let (real, _, unit) = as_number_or_return!(x);
|
||||||
@ -14,7 +14,7 @@ pub mod special_funcs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) mod funcs {
|
pub(crate) mod funcs {
|
||||||
use crate::kalk_num::KalkValue;
|
use crate::kalk_value::KalkValue;
|
||||||
use crate::prelude::funcs::abs;
|
use crate::prelude::funcs::abs;
|
||||||
use crate::{as_number_or_return, float};
|
use crate::{as_number_or_return, float};
|
||||||
|
|
||||||
@ -107,8 +107,8 @@ pub(crate) mod funcs {
|
|||||||
crate::prelude::funcs::sqrt(
|
crate::prelude::funcs::sqrt(
|
||||||
abs_x
|
abs_x
|
||||||
.clone()
|
.clone()
|
||||||
.mul_without_unit(abs_x)
|
.mul_without_unit(&abs_x)
|
||||||
.add_without_unit(abs_y.clone().mul_without_unit(abs_y)),
|
.add_without_unit(&abs_y.clone().mul_without_unit(&abs_y)),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
KalkValue::Number(real.hypot(real_rhs), float!(0), unit)
|
KalkValue::Number(real.hypot(real_rhs), float!(0), unit)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user