Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SevenMath Functions (continued)

Sign Function

Overview

The Sign function tests the sign of the parameter and returns 1, 0 or -1 for positive, zero or negative, respectively.

Syntax/Parameters

Syntax

int = sign ( int value | float value | string value );

Parameters

value

An int, float or string as the value to be tested. If the value is a string, it will be converted to an integer or floating point number. See Remarks.

Return Value

Returns an int as 1, 0 or -1 for positive, zero or negative, respectively or a formatted error code on an error. Use the GetLastError or GetLastErrorMessage for additional information.

An error condition is only returned with using the function with a string parameter.

Remarks

The Sign function is a mathematical function that extracts the sign of a number.

Note that when using a string, it is trimmed and converted. If a syntax error in encountered, a formatted error code will be returned by the function.

Also note that this is different than the trig Sine function.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic

Page revised 2024-12-13