Explorar o código

INF and NAN support.

woollybah %!s(int64=11) %!d(string=hai) anos
pai
achega
fddedf4cd9
Modificáronse 2 ficheiros con 15 adicións e 0 borrados
  1. 7 0
      blitz.mod/blitz_cclib.c
  2. 8 0
      blitz.mod/blitz_cclib.h

+ 7 - 0
blitz.mod/blitz_cclib.c

@@ -2,6 +2,13 @@
 #include "blitz.h"
 #include <math.h>
 
+float bbNANf = 0.0/0.0;
+double bbNANd = 0.0/0.0;
+float bbPOSINFf = 1.0/0.0;
+double bbPOSINFd = 1.0/0.0;
+float bbNEGINFf = -1.0/0.0;
+double bbNEGINFd = -1.0/0.0;
+
 int bbIntAbs( int x ){
 	return x>=0 ? x : -x;
 }

+ 8 - 0
blitz.mod/blitz_cclib.h

@@ -4,10 +4,18 @@
 
 #include "blitz_types.h"
 
+
 #ifdef __cplusplus
 extern "C"{
 #endif
 
+float bbNANf;
+double bbNANd;
+float bbPOSINFf;
+double bbPOSINFd;
+float bbNEGINFf;
+double bbNEGINFd;
+
 int		bbIntAbs( int x );
 int		bbIntSgn( int x );
 int		bbIntMod( int x,int y );