Fix annoying compiler warning with NaN number detection - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2011年10月29日 17:46:16 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2011年10月29日 17:46:16 +0200
commit3ea45399711a9bc8a34a6e6ded7289d0c35be450 (patch)
treebe39d652c439e559bbb67794368912861d5c24ba
parentad7c4dced1f3a8a2e4fe0078f085c21b01a35b0d (diff)
downloadgsl-shell-3ea45399711a9bc8a34a6e6ded7289d0c35be450.tar.gz
Fix annoying compiler warning with NaN number detection
Diffstat
-rw-r--r--gs-types.c 3
1 files changed, 1 insertions, 2 deletions
diff --git a/gs-types.c b/gs-types.c
index a16ac21e..54f781e5 100644
--- a/gs-types.c
+++ b/gs-types.c
@@ -230,13 +230,12 @@ double
gs_check_number (lua_State *L, int index, int check_normal)
{
double v;
- int fpclass;
if (!lua_isnumber (L, index))
return gs_type_error (L, index, "real number");
v = lua_tonumber (L, index);
if (check_normal)
{
- if (isinf(v) || isnan(fpclass))
+ if (isinf(v) || fpclassify(v) == FP_NAN)
return luaL_error (L, "invalid 'nan' or 'inf' number", index);
}
return v;
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月27日 05:04:42 +0000

AltStyle によって変換されたページ (->オリジナル) /