Wired up the OwnedLiterals to the math functions.
This commit is contained in:
@@ -138,21 +138,21 @@ impl Rem<MathNumber> for MathNumber {
|
||||
}
|
||||
|
||||
impl MathNumber {
|
||||
fn math_abs(&self) -> Option<OwnedLiteral> {
|
||||
pub fn math_abs(&self) -> Option<OwnedLiteral> {
|
||||
match self {
|
||||
MathNumber::Failure => None,
|
||||
MathNumber::Integer(num) => num.abs().try_into().ok(),
|
||||
MathNumber::Decimal(num) => Some(OwnedLiteral::LFloat(num.abs())),
|
||||
}
|
||||
}
|
||||
fn math_floor(&self) -> Option<OwnedLiteral> {
|
||||
pub fn math_floor(&self) -> Option<OwnedLiteral> {
|
||||
match self {
|
||||
MathNumber::Failure => None,
|
||||
MathNumber::Integer(num) => (*num).try_into().ok(),
|
||||
MathNumber::Decimal(num) => Some(OwnedLiteral::LFloat(num.floor())),
|
||||
}
|
||||
}
|
||||
fn math_ceil(&self) -> Option<OwnedLiteral> {
|
||||
pub fn math_ceil(&self) -> Option<OwnedLiteral> {
|
||||
match self {
|
||||
MathNumber::Failure => None,
|
||||
MathNumber::Integer(num) => (*num).try_into().ok(),
|
||||
|
||||
Reference in New Issue
Block a user