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