absolutevalue/ko: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Text replacement - "source>" to "syntaxhighlight>")
m (Text replacement - "<source" to "<syntaxhighlight")
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: val = absolutevalue(num)]
[h: val = absolutevalue(num)]
</syntaxhighlight>
</syntaxhighlight>
이 함수를 아래와 같이 줄여서 쓸 수 있다:
이 함수를 아래와 같이 줄여서 쓸 수 있다:
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: val = abs(num)]
[h: val = abs(num)]
</syntaxhighlight>
</syntaxhighlight>
Line 14: Line 14:
|examples=
|examples=
====음수(Negative Number)====
====음수(Negative Number)====
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: absolutevalue(-3)]
[r: absolutevalue(-3)]
</syntaxhighlight>
</syntaxhighlight>
Returns:<source lang="mtmacro" line start=2>3</syntaxhighlight>
Returns:<syntaxhighlight lang="mtmacro" line start=2>3</syntaxhighlight>




====양수(Positive Number)====
====양수(Positive Number)====
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: abs(4)]
[r: abs(4)]
</syntaxhighlight>
</syntaxhighlight>
Returns:<source lang="mtmacro" line start=2>4</syntaxhighlight>
Returns:<syntaxhighlight lang="mtmacro" line start=2>4</syntaxhighlight>




====소수(Decimal Number)====
====소수(Decimal Number)====
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: abs(3.4)]
[r: abs(3.4)]
</syntaxhighlight>
</syntaxhighlight>
Returns:<source lang="mtmacro" line start=2>3.4</syntaxhighlight>
Returns:<syntaxhighlight lang="mtmacro" line start=2>3.4</syntaxhighlight>


}}
}}
[[Category:Mathematical Function]]
[[Category:Mathematical Function]]

Latest revision as of 23:59, 14 March 2023

absolutevalue() Function

절대값을 반환한다. The absolute value of a number 는 부호(+,-)를 제외하곤 바뀌지 않는다.

Usage

[h: val = absolutevalue(num)]

이 함수를 아래와 같이 줄여서 쓸 수 있다:

[h: val = abs(num)]

Examples

====음수(Negative Number)====
[r: absolutevalue(-3)]
Returns:
3


양수(Positive Number)

[r: abs(4)]
Returns:
4


소수(Decimal Number)

[r: abs(3.4)]
Returns:
3.4