タグ

math.hに関するbananapenguinのブックマーク (1)

  • C言語関数辞典 - nextafter, nextafterf, nextafterl

    nextafterl 関数は,実軸上で x から見て y の方向にある x の次に表現可能な値を求め,long double 型で返します. nextafter,nextafterf,nextafterl 関数は,x がその型で表現できる最大の有限な値であり,かつその結果が無限大かその型で表現できない場合,値域エラー (range error) が発生する事があります. よく似た関数に,nexttoward,nexttowardf,nexttowardl 関数があります. 戻り値 y の方向にある x の次の値 C言語サンプルプログラム 以下に nextafter 関数を使用したサンプルプログラムを示します. /* header files */ #include <stdio.h> #include <stdlib.h> #include <math.h> /* main */ int

  • 1