Skip to content

Commit

Permalink
smarter alias for invert & recip
Browse files Browse the repository at this point in the history
  • Loading branch information
vic1707 committed Nov 29, 2023
1 parent e321698 commit c98ca30
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions src/token/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ impl<'a> Identifier<'a> {
"trunc" => built_in_functions::TRUNC.into(),
"sum" => built_in_functions::SUM.into(),
"mean" => built_in_functions::MEAN.into(),
"invert" => built_in_functions::INVERT.into(),
"recip" => built_in_functions::RECIP.into(),
"invert" | "recip" => built_in_functions::RECIP.into(),
"min" => built_in_functions::MIN.into(),
"max" => built_in_functions::MAX.into(),
"hypot" => built_in_functions::HYPOT.into(),
Expand Down
2 changes: 0 additions & 2 deletions src/utils/built_in_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ pub const MEAN: Function = xprs_fn!("mean", |args| {
args.iter().sum::<f64>() / args.len() as f64
});

/// Reciprocal builtin function.
pub const INVERT: Function = xprs_fn!("invert", f64::recip, 1);
/// Reciprocal builtin function.
pub const RECIP: Function = xprs_fn!("recip", f64::recip, 1);

Expand Down

0 comments on commit c98ca30

Please sign in to comment.