From 4e0cfa02a4f884b3f54f476d596bacd1f34d6a50 Mon Sep 17 00:00:00 2001 From: Elvio Basello Date: Tue, 4 Mar 2008 17:48:09 +0000 Subject: some little fixes around; fixed docs; bumped version to 3.4.0 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1183 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/math/libkvimath.cpp | 64 +++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 37 deletions(-) (limited to 'src/modules/math/libkvimath.cpp') diff --git a/src/modules/math/libkvimath.cpp b/src/modules/math/libkvimath.cpp index af7152c96..62b7cda75 100644 --- a/src/modules/math/libkvimath.cpp +++ b/src/modules/math/libkvimath.cpp @@ -31,12 +31,12 @@ // Workaround for lost isnan and isinf definitions after // inclusion of iostream.h on some MacOS X systems #ifdef Q_OS_MACX - #ifndef isnan - extern "C" int isnan (double); - #endif - #ifndef isinf - extern "C" int isinf (double); - #endif + #ifndef isnan + extern "C" int isnan (double); + #endif + #ifndef isinf + extern "C" int isinf (double); + #endif #endif #define MATH_KVS_1PARAM_FUNCTION(__fncname,__paramname,__mathcallname) \ @@ -54,40 +54,31 @@ static bool __fncname(KviKvsModuleFunctionCall * c) \ // dobbiamo testare meglio, i risultati. static double cbrt(double x) { - if (x > 0.0) - return pow(x, 1.0/3.0); - else - return -pow(-x, 1.0/3.0); + if (x > 0.0) return pow(x, 1.0/3.0); + else return -pow(-x, 1.0/3.0); } + static int isinf (double d) { - int expon = 0; - double val = frexp (d, &expon); - if (expon == 1025) { - if (val == 0.5) { - return 1; - } else if (val == -0.5) { - return -1; - } else { - return 0; - } - } else { - return 0; - } + int expon = 0; + double val = frexp (d, &expon); + if (expon == 1025) { + if (val == 0.5) return 1; + else if (val == -0.5) return -1; + else return 0; + } else { + return 0; + } } static int isnan (double d) { - int expon = 0; - double val = frexp (d, &expon); - if (expon == 1025) { - if (val == 0.5) { - return 0; - } else if (val == -0.5) { - return 0; - } else { - return 1; - } - } else { - return 0; - } + int expon = 0; + double val = frexp (d, &expon); + if (expon == 1025) { + if (val == 0.5) return 0; + else if (val == -0.5) return 0; + else return 1; + } else { + return 0; + } } #endif /* @@ -442,7 +433,6 @@ static bool math_kvs_fnc_e(KviKvsModuleFunctionCall * c) #endif static bool math_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"sin",math_kvs_fnc_sin); KVSM_REGISTER_FUNCTION(m,"cos",math_kvs_fnc_cos); KVSM_REGISTER_FUNCTION(m,"tan",math_kvs_fnc_tan); -- cgit v1.3.1-10-gc9f91