OCLOperators Number::abs () : Number
(Created page with "Returns the greatest number between ''self'' and *r*. {| class="wikitable" !Expression !Result |- |6.max(3) |6 |- |6.max(5.2) |6.0 |- |(2.3).max(3) |3.0 |- |(2.3).max(5.2) |...")
 
(Automatically adding template at the end of the page.)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Returns the greatest number between ''self'' and *r*.
Returns the absolute value of ''self'', ''self'' if it is already a positive number.  
{| class="wikitable"
{| class="wikitable"
!Expression
!Expression
!Result
!Result
|-
|-
|6.max(3)
|(-2.3).abs()
|6
|2.3
|-
|-
|6.max(5.2)
| -5.abs()
|6.0
|5
|-
|(2.3).max(3)
|3.0
|-
|(2.3).max(5.2)
|5.2
|}
|}
[[Category:OCL Number Operators]]
{{Edited|July|12|2024}}

Latest revision as of 15:39, 10 February 2024

Returns the absolute value of selfself if it is already a positive number.

Expression Result
(-2.3).abs() 2.3
-5.abs() 5
This page was edited 89 days ago on 02/10/2024. What links here