Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
drewmccluskey edited this page Jan 9, 2019 · 3 revisions

sign

Returns the sign of n

Syntax:

sign(n)
Argument Description
Real n The value to sign

Returns: int

Description:

This function returns whether a number is positive, negative or neither and returns 1, -1, or 0 respectively.

Example:

int number = 5;
var quality = sign(number); //return 1

This code will sign int number to var quality with returning value 1.

Example2:

int number = -5;
var quality = sign(number); //return -1

This code will sign int number to var quality with returning value -1.

Back to number_functions

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /