Document of c-modernization-kit (calc) 1.0.0
Loading...
Searching...
No Matches
divide.c
Go to the documentation of this file.
1
15
16#include <libcalcbase.h>
17#include <stddef.h>
18
19/* doxygen コメントは、ヘッダに記載 */
20int 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}
int divide(const int a, const int b, int *result)
2 つの整数を除算します。
Definition divide.c:20
#define CALC_SUCCESS
成功の戻り値を表す定数。
#define CALC_ERROR
失敗の戻り値を表す定数。
計算ライブラリ (静的リンク用) のヘッダーファイル。