Skip to content

abs

Math Support Available

This website is going to provide examples in math, such as y = \sqrt{x^2-1} . Please come back to check later.

Description

Invocation # of parameters # of returns isElementwise Note
@abs(x) 1 1 Yes Return absolute value

Type Rules

bool -> bool
i8   -> i8
i16  -> i16
i32  -> i32
i64  -> i64
f32  -> f32
f64  -> f64
_    -> domain error

Shape Rules

Monadic elementwise shape rules

Examples

    @abs((-1,2,3):i32)
(1,2,3):i32