hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

fenv_func.ha (893B)


      1 // SPDX-License-Identifier: MPL-2.0
      2 // (c) Hare authors <https://harelang.org>
      3 
      4 use rt;
      5 
      6 // Accepts a set of flags from [[fexcept]] ORed together and clears
      7 // exceptions corresponding to the given flags.
      8 export fn clearexcept(ex: fexcept) void = rt::feclearexcept(ex: uint);
      9 
     10 // Accepts a set of flags from [[fexcept]] ORed together and raises
     11 // exceptions corresponding to the given flags.
     12 export fn raiseexcept(ex: fexcept) void = rt::feraiseexcept(ex: uint);
     13 
     14 // Accepts a set of flags from [[fexcept]] ORed together and returns
     15 // the subset that is currently raised
     16 export fn testexcept(ex: fexcept) fexcept = rt::fetestexcept(ex: uint): fexcept;
     17 
     18 // Returns the value corresponding to the current rounding mode
     19 export fn getround() fround = rt::fegetround(): fround;
     20 
     21 // Sets the rounding mode to the specified value
     22 export fn setround(mode: fround) void = rt::fesetround(mode: uint);