Subversion Repositories HelenOS-historic

Rev

Rev 542 | Rev 647 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 542 Rev 563
Line 32... Line 32...
32
 
32
 
33
typedef union {
33
typedef union {
34
    float f;
34
    float f;
35
    struct  {
35
    struct  {
36
        #ifdef __BIG_ENDIAN__
36
        #ifdef __BIG_ENDIAN__
37
        __u8 sign:1;
37
        __u32 sign:1;
38
        __u8 exp:8;
38
        __u32 exp:8;
39
        __u32 mantisa:23;
39
        __u32 mantisa:23;
40
        #else
-
 
41
        #ifdef __LITTLE_ENDIAN__
40
        #elif defined __LITTLE_ENDIAN__
42
        __u32 mantisa:23;
41
        __u32 mantisa:23;
43
        __u8 exp:8;
42
        __u32 exp:8;
44
        __u8 sign:1;
43
        __u32 sign:1;
45
        #else 
44
        #else 
-
 
45
        #error "Unknown endians."
46
        #endif
46
        #endif
47
        } parts __attribute__ ((packed));
47
        } parts __attribute__ ((packed));
48
    } float32_t;
48
    } float32;
49
   
49
   
50
typedef union {
50
typedef union {
51
    double d;
51
    double d;
52
    struct  {
52
    struct  {
53
        #ifdef __BIG_ENDIAN__
53
        #ifdef __BIG_ENDIAN__
54
        __u8 sign:1;
54
        __u64 sign:1;
55
        __u8 exp:11;
55
        __u64 exp:11;
56
        __u32 mantisa:52;
56
        __u64 mantisa:52;
57
        #else
-
 
58
        #ifdef __LITTLE_ENDIAN__
57
        #elif defined __LITTLE_ENDIAN__
59
        __u32 mantisa:52;
58
        __u64 mantisa:52;
60
        __u8 exp:11;
59
        __u64 exp:11;
61
        __u8 sign:1;
60
        __u64 sign:1;
62
        #else 
61
        #else 
-
 
62
        #error "Unknown endians."
63
        #endif
63
        #endif
64
        } parts __attribute__ ((packed));
64
        } parts __attribute__ ((packed));
65
    } float64_t;
65
    } float64;
66
 
66
 
67
#define FLOAT32_MAX 0x7f800000
67
#define FLOAT32_MAX 0x7f800000
68
#define FLOAT32_MIN 0xff800000
68
#define FLOAT32_MIN 0xff800000
69
#define FLOAT64_MAX
69
#define FLOAT64_MAX
70
#define FLOAT64_MIN
70
#define FLOAT64_MIN