Abs: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Created page with "== ABS Function == ABS(''number'') '''Description''' ABS returns the absolute value, or unsigned magnitude, of a numeric expression. The required parameter, ''number'', is ..."
 
No edit summary
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== ABS Function ==
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''


ABS(''number'')
Abs(''number'')


'''Description'''
== Description ==


ABS returns the absolute value, or unsigned magnitude, of a numeric expression. The required parameter, ''number'', is any valid numeric expression. If number is NULL, ABS returns NULL.
Abs returns the absolute value, or unsigned magnitude, of a numeric expression. The required parameter, ''number'', is any valid numeric expression. If ''number'' is NULL, Abs returns NULL.


'''Example'''
== Example (BASIC) ==


REM ABS Example
<pre>
'ABS returns the absolute value of a number.
Rem Abs Example
PRINT "ABS(-2) = " & ABS(-2)
'Abs returns the absolute value of a number.
PRINT "ABS(2) = " & ABS(2)
Print "Abs(-2) = " & Abs(-2)
Print "Abs(2) = " & Abs(2)
</pre>


'''Output'''
== Output ==


ABS(-2) = 2
<pre>
ABS(2) = 2
Abs(-2) = 2
Abs(2) = 2
</pre>


'''Related Items'''
== Related Items ==


[[sgn|SGN]]
[[sgn|Sgn]]
 
 
[[Category:Language Reference]]
 
[[Category:Math]]

Latest revision as of 18:08, 24 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

Abs(number)

Description

Abs returns the absolute value, or unsigned magnitude, of a numeric expression. The required parameter, number, is any valid numeric expression. If number is NULL, Abs returns NULL.

Example (BASIC)

Rem Abs Example
'Abs returns the absolute value of a number.
Print "Abs(-2) = " & Abs(-2)
Print "Abs(2) = " & Abs(2)

Output

Abs(-2) = 2
Abs(2) = 2

Related Items

Sgn