XINU
Functions
abs.c File Reference

整数(int型)の絶対値を返す。 More...

Go to the source code of this file.

Functions

int abs (int arg)
 整数の絶対値(int型)を返す。 More...
 

Detailed Description

整数(int型)の絶対値を返す。

Definition in file abs.c.

Function Documentation

◆ abs()

int abs ( int  arg)

整数の絶対値(int型)を返す。

Parameters
[in]arg絶対値に変換したい整数(int型)
Returns
引数argの絶対値(int型)

Definition at line 13 of file abs.c.

14 {
15  if (arg < 0)
16  arg = -arg;
17  return (arg);
18 }