lib.rs 405 B

1234567891011121314151617181920
  1. //! float.h implementation for Redox, following
  2. //! http://pubs.opengroup.org/onlinepubs/7908799/xsh/float.h.html
  3. #![no_std]
  4. extern crate fenv;
  5. extern crate platform;
  6. use platform::types::*;
  7. use fenv::{fegetround, FE_TONEAREST};
  8. pub const FLT_RADIX: c_int = 2;
  9. #[no_mangle]
  10. pub unsafe extern "C" fn flt_rounds() -> c_int {
  11. match fegetround() {
  12. FE_TONEAREST => 1,
  13. _ => -1,
  14. }
  15. }