sign

sign(x)

Return zero if x==0 and $x/|x|$ otherwise (i.e., ±1 for real x).

Examples

julia> sign(0)
0
julia> sign(-7)
-1
julia> sign(7)
1

See Also

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: