MCPcopy Index your code
hub / github.com/endbasic/endbasic / new

Method new

std/src/numerics.rs:127–145  ·  view source on GitHub ↗

Creates a new instance of the function.

()

Source from the content-addressed store, hash-verified

125impl AbsFunction {
126 /// Creates a new instance of the function.
127 pub fn new() -> Rc<Self> {
128 Rc::from(Self {
129 metadata: CallableMetadataBuilder::new("ABS")
130 .with_return_type(ExprType::Double)
131 .with_syntax(&[(
132 &[SingularArgSyntax::RequiredValue(
133 RequiredValueSyntax {
134 name: Cow::Borrowed("expr"),
135 vtype: ExprType::Double,
136 },
137 ArgSepSyntax::End,
138 )],
139 None,
140 )])
141 .with_category(CATEGORY)
142 .with_description("Returns the absolute value of a number.")
143 .build(),
144 })
145 }
146}
147
148impl Callable for AbsFunction {

Callers

nothing calls this directly

Calls 5

with_descriptionMethod · 0.80
with_categoryMethod · 0.80
with_syntaxMethod · 0.80
with_return_typeMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected