Assert
提供: floatingexception
Assert
C/C++言語とPerl言語には、「assert」というデバッグ支援マクロがあります。 正常な場合に成立する論理式を書きます。 論理式が成立しないと、エラーメッセージを表示してアボートします。 例を示します。
#include <assert.h>
#include <math.h>
...
assert(0.0 <= x);
y = sqrt(x);