Mojo function
abs
abs[T: Absable](value: T) -> $0
Get the absolute value of the given object.
Parameters:
- βT (
Absable
): The type conforming to Absable.
Args:
- βvalue (
T
): The object to get the absolute value of.
Returns:
The absolute value of the object.
abs(value: IntLiteral) -> IntLiteral
Get the absolute value of the given IntLiteral.
Args:
- βvalue (
IntLiteral
): The IntLiteral to get the absolute value of.
Returns:
The absolute value of the IntLiteral.
abs(value: FloatLiteral) -> FloatLiteral
Get the absolute value of the given FloatLiteral.
Args:
- βvalue (
FloatLiteral
): The FloatLiteral to get the absolute value of.
Returns:
The absolute value of the FloatLiteral.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?