absolutevalue/ko

From RPTools Wiki
Revision as of 17:11, 14 March 2023 by Taustin (talk | contribs) (Text replacement - "source>" to "syntaxhighlight>")
Jump to navigation Jump to search

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>