Skip to content

format

typescript
Mathf.Sign(val)

class: Mathf

description

Returns the sign (positive/negative) of v.

parameter

param_nametypedescription
valnumberThe specified value.

return

typedescription
numberThe sign of v.

code example

typescript
// Get the sign of val
let sign = Mathf.Sign(7.5) // sign = 1