… | |
… | |
558 | #define ECB_STDFP 0 |
558 | #define ECB_STDFP 0 |
559 | #endif |
559 | #endif |
560 | |
560 | |
561 | #ifndef ECB_NO_LIBM |
561 | #ifndef ECB_NO_LIBM |
562 | |
562 | |
563 | #if __STDC_IEC_559__ || ECB_STDFP |
|
|
564 | /* we assume this is defined for most C and many C++ compilers */ |
|
|
565 | ecb_inline ecb_bool ecb_float_ieee (void) ecb_const; |
|
|
566 | ecb_inline ecb_bool ecb_float_ieee (void) { return 1; } |
|
|
567 | ecb_inline ecb_bool ecb_double_ieee (void) ecb_const; |
|
|
568 | ecb_inline ecb_bool ecb_double_ieee (void) { return 1; } |
|
|
569 | #elif ECB_CPP |
|
|
570 | #include <limits> |
|
|
571 | ecb_inline ecb_bool ecb_float_ieee (void) ecb_const; |
|
|
572 | ecb_inline ecb_bool ecb_float_ieee (void) { return std::numeric_limits<float >::is_iec559; } |
|
|
573 | ecb_inline ecb_bool ecb_double_ieee (void) ecb_const; |
|
|
574 | ecb_inline ecb_bool ecb_double_ieee (void) { return std::numeric_limits<double>::is_iec559; } |
|
|
575 | #else |
|
|
576 | ecb_inline ecb_bool ecb_float_ieee (void) ecb_const; |
|
|
577 | ecb_inline ecb_bool ecb_float_ieee (void) { return 0; } |
|
|
578 | ecb_inline ecb_bool ecb_double_ieee (void) ecb_const; |
|
|
579 | ecb_inline ecb_bool ecb_double_ieee (void) { return 0; } |
|
|
580 | #endif |
|
|
581 | |
|
|
582 | /* convert a float to ieee single/binary32 */ |
563 | /* convert a float to ieee single/binary32 */ |
583 | ecb_function_ uint32_t ecb_float_to_binary32 (float x) ecb_const; |
564 | ecb_function_ uint32_t ecb_float_to_binary32 (float x) ecb_const; |
584 | ecb_function_ uint32_t |
565 | ecb_function_ uint32_t |
585 | ecb_float_to_binary32 (float x) |
566 | ecb_float_to_binary32 (float x) |
586 | { |
567 | { |