|
Abs | ||||
PositiveResult = Abs(InputValue) | ||||
Parameters: InputValue = Then Value/Variable or expression you wish to return the absolute (positive) value of |
||||
Returns: PositiveResult = The Abs function always returns a positive result |
||||
The Abs function takes the input value or expression and returns this value in a positive form. So negative values will be returned as postives while postives will be unchanged. FACTS: * Abs returns a positive result no matter what the input. * The Abs function was changed in from PlayBASIC V1.64M (And above), so that it now returns Integers when you feed Integers and Floats when you feed it floats. Older versions always returned floats. Mini Tutorial: Showing the effect of the ABS function on the values -100 and 100.
This example would output.
Mini Tutorial: Using ABS to ensure results are always positive.
This example would output.
|
Related Info: | Ceil | Int | Neg | Sgn : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |