![]() |
|
Navigation |
Synopsis Absolute value of a number.
Function
&T <: num abs(&T <: num N)
Usage
import util::Math;
Description Absolute value of the number
n . The result type is equal to the type of the argument n .
Examples
rascal>import util::Math; ok rascal>abs(13) int: 13 rascal>abs(-13) int: 13 rascal>abs(3.14) real: 3.14 rascal>abs(-3.14) real: 3.14 Questions
Question [1].
![]() ![]()
Question [2].
![]() ![]()
Question [3].
![]() ![]()
Question [4].
![]() ![]() ![]() |