≫ ホーム ≫ C言語ヘッダファイル別一覧 | C言語アルファベット別一覧 ≫ math.h ≫ isless
1 番目の引数が,2 番目の引数より小さいかどうかを判定します.
#include <math.h>
int isless( 実浮動小数点型 x, 実浮動小数点型 y );
isless マクロは,x が y より小さいかどうかを判定します.
以下に isless マクロを使用したサンプルプログラムを示します.
/* header files */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* main */
int main(void) {
double x = 10.0;
double y = 10.1;
if ( isless(x, y) ) {
printf("%.1f < %.1f\n", x, y);
} else {
printf("%.1f >= %.1f\n", x, y);
}
return EXIT_SUCCESS;
}
サンプルプログラムの実行結果は以下のようになります.
10.0 < 10.1