absolutevalue/ko: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Absolutevalue/ko to absolutevalue/ko: Converting page titles to lowercase)
m (Text replacement - "source>" to "syntaxhighlight>")
Line 6: Line 6:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: val = absolutevalue(num)]
[h: val = absolutevalue(num)]
</source>
</syntaxhighlight>
이 함수를 아래와 같이 줄여서 쓸 수 있다:
이 함수를 아래와 같이 줄여서 쓸 수 있다:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: val = abs(num)]
[h: val = abs(num)]
</source>
</syntaxhighlight>


|examples=
|examples=
Line 16: Line 16:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: absolutevalue(-3)]
[r: absolutevalue(-3)]
</source>
</syntaxhighlight>
Returns:<source lang="mtmacro" line start=2>3</source>
Returns:<source lang="mtmacro" line start=2>3</syntaxhighlight>




Line 23: Line 23:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: abs(4)]
[r: abs(4)]
</source>
</syntaxhighlight>
Returns:<source lang="mtmacro" line start=2>4</source>
Returns:<source lang="mtmacro" line start=2>4</syntaxhighlight>




Line 30: Line 30:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: abs(3.4)]
[r: abs(3.4)]
</source>
</syntaxhighlight>
Returns:<source lang="mtmacro" line start=2>3.4</source>
Returns:<source lang="mtmacro" line start=2>3.4</syntaxhighlight>


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

Revision as of 17:11, 14 March 2023

absolutevalue() Function

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

Usage

<source lang="mtmacro" line> [h: val = absolutevalue(num)] </syntaxhighlight> 이 함수를 아래와 같이 줄여서 쓸 수 있다: <source lang="mtmacro" line> [h: val = abs(num)] </syntaxhighlight>

Examples

====음수(Negative Number)====

<source lang="mtmacro" line> [r: absolutevalue(-3)] </syntaxhighlight> Returns:<source lang="mtmacro" line start=2>3</syntaxhighlight>


양수(Positive Number)

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


소수(Decimal Number)

<source lang="mtmacro" line> [r: abs(3.4)] </syntaxhighlight>

Returns:<source lang="mtmacro" line start=2>3.4</syntaxhighlight>