Abs: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.'' | |||
Abs(''number'') | |||
== Description == | == Description == | ||
Line 5: | Line 7: | ||
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) == | ||
<pre> | <pre> | ||
Rem Abs Example | |||
'Abs returns the absolute value of a number. | 'Abs returns the absolute value of a number. | ||
Print "Abs(-2) = " & Abs(-2) | |||
Print "Abs(2) = " & Abs(2) | |||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Line 20: | Line 23: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[sgn| | [[sgn|Sgn]] | ||
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