kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

math.h (1029B)


      1 /* math.h -- minimal freestanding declarations
      2  *
      3  * Declarations only; the definitions resolve from the host C library at
      4  * link time (libSystem on Darwin, libm on ELF). kit itself uses these
      5  * in the rv64 interpreter (src/emu/cpu.c) to emulate FSQRT and the
      6  * fused-multiply-add family with IEEE-correct rounding. */
      7 #ifndef KIT_MATH_H
      8 #define KIT_MATH_H
      9 
     10 double sqrt(double x);
     11 float sqrtf(float x);
     12 
     13 double fma(double x, double y, double z);
     14 float fmaf(float x, float y, float z);
     15 
     16 double fabs(double x);
     17 float fabsf(float x);
     18 
     19 double floor(double x);
     20 float floorf(float x);
     21 double ceil(double x);
     22 float ceilf(float x);
     23 double trunc(double x);
     24 float truncf(float x);
     25 double round(double x);
     26 float roundf(float x);
     27 double rint(double x);
     28 float rintf(float x);
     29 double nearbyint(double x);
     30 float nearbyintf(float x);
     31 
     32 double copysign(double x, double y);
     33 float copysignf(float x, float y);
     34 
     35 double scalbn(double x, int n);
     36 float scalbnf(float x, int n);
     37 
     38 double pow(double x, double y);
     39 float powf(float x, float y);
     40 
     41 #endif