Unified · Split
| @@ -1,3 +1,5 @@ | ||
| 1 | +20120103 | |
| 2 | + avoid re-defining isnan; use isNaN instead | |
| 1 | 3 | 20111231 |
| 2 | 4 | Linux/*/include/emu.h adjustments for USE_PTHREADS for non-x86 processors |
| 3 | 5 | 20111221 |
| @@ -20,7 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #define getwd infgetwd |
| 22 | 22 | |
| 23 | −#undef isnan | |
| 24 | 23 | #define round infround |
| 25 | 24 | #define fmax inffmax |
| 26 | 25 | #define log2 inflog2 |
| @@ -49,6 +48,15 @@ typedef unsigned short u16int; · 22 unmodified lines | ||
| 49 | 48 | typedef unsigned char u8int; |
| 50 | 49 | typedef unsigned long uintptr; |
| 51 | 50 | |
| 51 | +typedef signed char int8; | |
| 52 | +typedef unsigned char uint8; | |
| 53 | +typedef short int16; | |
| 54 | +typedef unsigned short uint16; | |
| 55 | +typedef int int32; | |
| 56 | +typedef unsigned int uint32; | |
| 57 | +typedef long long int64; | |
| 58 | +typedef unsigned long long uint64; | |
| 59 | + | |
| 52 | 60 | #define USED(x) if(x){}else{} |
| 53 | 61 | #define SET(x) |
| 54 | 62 | |
| @@ -20,7 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #define getwd infgetwd |
| 22 | 22 | |
| 23 | −#undef isnan | |
| 24 | 23 | #define round infround |
| 25 | 24 | #define fmax inffmax |
| 26 | 25 | #define log2 inflog2 |
| @@ -50,6 +49,15 @@ typedef unsigned short u16int; · 23 unmodified lines | ||
| 50 | 49 | typedef unsigned char u8int; |
| 51 | 50 | typedef unsigned long uintptr; |
| 52 | 51 | |
| 52 | +typedef signed char int8; | |
| 53 | +typedef unsigned char uint8; | |
| 54 | +typedef short int16; | |
| 55 | +typedef unsigned short uint16; | |
| 56 | +typedef int int32; | |
| 57 | +typedef unsigned int uint32; | |
| 58 | +typedef long long int64; | |
| 59 | +typedef unsigned long long uint64; | |
| 60 | + | |
| 53 | 61 | #define USED(x) if(x){}else{} |
| 54 | 62 | #define SET(x) |
| 55 | 63 | |
| @@ -43,6 +43,15 @@ typedef unsigned short u16int; · 42 unmodified lines | ||
| 43 | 43 | typedef unsigned char u8int; |
| 44 | 44 | typedef unsigned long uintptr; |
| 45 | 45 | |
| 46 | +typedef signed char int8; | |
| 47 | +typedef unsigned char uint8; | |
| 48 | +typedef short int16; | |
| 49 | +typedef unsigned short uint16; | |
| 50 | +typedef int int32; | |
| 51 | +typedef unsigned int uint32; | |
| 52 | +typedef long long int64; | |
| 53 | +typedef unsigned long long uint64; | |
| 54 | + | |
| 46 | 55 | /* handle conflicts with host os libs */ |
| 47 | 56 | #define getwd infgetwd |
| 48 | 57 | #define scalb infscalb |
| @@ -50,7 +59,6 @@ typedef unsigned long uintptr; · 1 unmodified line | ||
| 50 | 59 | #define panic infpanic |
| 51 | 60 | #define rint infrint |
| 52 | 61 | #define rcmd infrcmd |
| 53 | −#undef isnan | |
| 54 | 62 | #define pow10 infpow10 |
| 55 | 63 | |
| 56 | 64 | #ifndef EMU |
| @@ -43,6 +43,15 @@ typedef unsigned short u16int; · 42 unmodified lines | ||
| 43 | 43 | typedef unsigned char u8int; |
| 44 | 44 | typedef unsigned long uintptr; |
| 45 | 45 | |
| 46 | +typedef signed char int8; | |
| 47 | +typedef unsigned char uint8; | |
| 48 | +typedef short int16; | |
| 49 | +typedef unsigned short uint16; | |
| 50 | +typedef int int32; | |
| 51 | +typedef unsigned int uint32; | |
| 52 | +typedef long long int64; | |
| 53 | +typedef unsigned long long uint64; | |
| 54 | + | |
| 46 | 55 | /* handle conflicts with host os libs */ |
| 47 | 56 | #define getwd infgetwd |
| 48 | 57 | #define scalb infscalb |
| @@ -50,7 +59,6 @@ typedef unsigned long uintptr; · 1 unmodified line | ||
| 50 | 59 | #define panic infpanic |
| 51 | 60 | #define rint infrint |
| 52 | 61 | #define rcmd infrcmd |
| 53 | −#undef isnan | |
| 54 | 62 | #define pow10 infpow10 |
| 55 | 63 | |
| 56 | 64 | #ifndef EMU |
| @@ -15,7 +15,6 @@ · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | #define getwd infgetwd |
| 17 | 17 | |
| 18 | −#undef isnan | |
| 19 | 18 | #define round infround |
| 20 | 19 | #define fmax inffmax |
| 21 | 20 | #define log2 inflog2 |
| @@ -49,6 +48,15 @@ typedef uvlong u64int; · 27 unmodified lines | ||
| 49 | 48 | |
| 50 | 49 | typedef uintptr_t uintptr; |
| 51 | 50 | |
| 51 | +typedef signed char int8; | |
| 52 | +typedef unsigned char uint8; | |
| 53 | +typedef short int16; | |
| 54 | +typedef unsigned short uint16; | |
| 55 | +typedef int int32; | |
| 56 | +typedef unsigned int uint32; | |
| 57 | +typedef long long int64; | |
| 58 | +typedef unsigned long long uint64; | |
| 59 | + | |
| 52 | 60 | typedef unsigned short Rune; |
| 53 | 61 | typedef unsigned int mpdigit; /* for /sys/include/mp.h */ |
| 54 | 62 | |
| @@ -20,7 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #define getwd infgetwd |
| 22 | 22 | |
| 23 | −#undef isnan | |
| 24 | 23 | #define round infround |
| 25 | 24 | #define fmax inffmax |
| 26 | 25 | #define log2 inflog2 |
| @@ -50,6 +49,15 @@ typedef unsigned short u16int; · 23 unmodified lines | ||
| 50 | 49 | typedef unsigned char u8int; |
| 51 | 50 | typedef unsigned long uintptr; |
| 52 | 51 | |
| 52 | +typedef signed char int8; | |
| 53 | +typedef unsigned char uint8; | |
| 54 | +typedef short int16; | |
| 55 | +typedef unsigned short uint16; | |
| 56 | +typedef int int32; | |
| 57 | +typedef unsigned int uint32; | |
| 58 | +typedef long long int64; | |
| 59 | +typedef unsigned long long uint64; | |
| 60 | + | |
| 53 | 61 | #define USED(x) if(x){}else{} |
| 54 | 62 | #define SET(x) |
| 55 | 63 | |
| @@ -1 +1 @@ | ||
| 1 | −#define VERSION "Fourth Edition (20111231)" | |
| 1 | +#define VERSION "Fourth Edition (20120103)" | |
| @@ -0,0 +1,15 @@ | ||
| 1 | +#include <lib9.h> | |
| 2 | + | |
| 3 | +int | |
| 4 | +isNaN(double d) | |
| 5 | +{ | |
| 6 | + return isnan(d); | |
| 7 | +} | |
| 8 | + | |
| 9 | +int | |
| 10 | +isInf(double d, int sign) | |
| 11 | +{ | |
| 12 | + if(sign < 0) | |
| 13 | + return isinf(d) < 0; | |
| 14 | + return isinf(d); | |
| 15 | +} | |
| @@ -7,3 +7,4 @@ TARGFILES=\ · 6 unmodified lines | ||
| 7 | 7 | setbinmode-Nt.$O\ |
| 8 | 8 | lock-Nt-386.$O\ |
| 9 | 9 | pread-Nt.$O\ |
| 10 | + isnan-posix.$O\ | |
| @@ -6,3 +6,4 @@ TARGFILES=\ · 5 unmodified lines | ||
| 6 | 6 | getcallerpc-$SYSTARG-$OBJTYPE.$O\ |
| 7 | 7 | getwd-posix.$O\ |
| 8 | 8 | sbrk-posix.$O\ |
| 9 | + isnan-posix.$O\ | |
| @@ -274,7 +274,7 @@ Math_isnan(void *fp) · 273 unmodified lines | ||
| 274 | 274 | |
| 275 | 275 | f = fp; |
| 276 | 276 | |
| 277 | − *f->ret = isnan(f->x); | |
| 277 | + *f->ret = isNaN(f->x); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | void |
| @@ -48,7 +48,6 @@ OFILES=\ · 47 unmodified lines | ||
| 48 | 48 | s_finite.$O\ |
| 49 | 49 | s_floor.$O\ |
| 50 | 50 | s_ilogb.$O\ |
| 51 | − s_isnan.$O\ | |
| 52 | 51 | s_log1p.$O\ |
| 53 | 52 | s_nextafter.$O\ |
| 54 | 53 | s_rint.$O\ |
| @@ -1045,7 +1045,7 @@ foldr(Node *n) · 1044 unmodified lines | ||
| 1045 | 1045 | n->left = nil; |
| 1046 | 1046 | n->right = nil; |
| 1047 | 1047 | |
| 1048 | − if(isnan(rv)) | |
| 1048 | + if(isNaN(rv)) | |
| 1049 | 1049 | rv = canonnan; |
| 1050 | 1050 | |
| 1051 | 1051 | n->rval = rv; |