Document of c-modernization-kit (calc)
1.0.0
Loading...
Searching...
No Matches
calc
libsrc
calcbase
divide.c
Go to the documentation of this file.
1
15
16
#include <
libcalcbase.h
>
17
#include <stddef.h>
18
19
/* doxygen コメントは、ヘッダに記載 */
20
int
divide
(
const
int
a,
const
int
b,
int
*result)
21
{
22
if
(result == NULL)
23
{
24
return
CALC_ERROR
;
25
}
26
if
(b == 0)
27
{
28
return
CALC_ERROR
;
29
}
30
*result = a / b;
31
return
CALC_SUCCESS
;
32
}
divide
int divide(const int a, const int b, int *result)
2 つの整数を除算します。
Definition
divide.c:20
CALC_SUCCESS
#define CALC_SUCCESS
成功の戻り値を表す定数。
Definition
libcalc_const.h:17
CALC_ERROR
#define CALC_ERROR
失敗の戻り値を表す定数。
Definition
libcalc_const.h:18
libcalcbase.h
計算ライブラリ (静的リンク用) のヘッダーファイル。
Generated by
1.14.0