XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Functions
math.h File Reference
#include <stdint.h>
#include <string.h>
Include dependency graph for math.h:

Go to the source code of this file.

Classes

union  ns_qjs_float_bits
 
union  ns_qjs_double_bits
 

Macros

#define M_E   2.7182818284590452354
 
#define M_LOG2E   1.4426950408889634074
 
#define M_LOG10E   0.43429448190325182765
 
#define M_LN2   0.69314718055994530942
 
#define M_LN10   2.30258509299404568402
 
#define M_PI   3.14159265358979323846
 
#define M_PI_2   1.57079632679489661923
 
#define M_PI_4   0.78539816339744830962
 
#define M_1_PI   0.31830988618379067154
 
#define M_2_PI   0.63661977236758134308
 
#define M_2_SQRTPI   1.12837916709551257390
 
#define M_SQRT2   1.41421356237309504880
 
#define M_SQRT1_2   0.70710678118654752440
 
#define HUGE_VAL   ((double)__builtin_huge_val())
 
#define HUGE_VALF   ((float)__builtin_huge_valf())
 
#define INFINITY   ((float)__builtin_inff() + 0.0)
 
#define NAN   ((float)__builtin_nanf("") + 0.0)
 
#define FP_NAN   4
 
#define FP_INFINITE   1
 
#define FP_ZERO   0
 
#define FP_SUBNORMAL   3
 
#define FP_NORMAL   2
 
#define fpclassify(x)   (ns_fpclassify_pattern(x))
 
#define isfinite(x)   (ns_fpclassify_pattern(x) != FP_NAN && ns_fpclassify_pattern(x) != FP_INFINITE)
 
#define isnormal(x)   (ns_fpclassify_pattern(x) == FP_NORMAL)
 
#define isnan(x)   (ns_fpclassify_pattern(x) == FP_NAN)
 
#define isinf(x)   (ns_fpclassify_pattern(x) == FP_INFINITE)
 

Functions

double ceil (double)
 
double cos (double)
 
double fabs (double)
 
double floor (double)
 
double fmod (double, double)
 
double modf (double, double *)
 
double pow (double, double)
 
double sin (double)
 
double sqrt (double)
 
double tan (double)
 
float ceilf (float)
 
float acosf (float)
 
float cosf (float)
 
float fabsf (float)
 
float floorf (float)
 
float fmodf (float, float)
 
float sinf (float)
 
float sqrtf (float)
 
float tanf (float)
 
float atanf (float)
 
float atan2f (float, float)
 
double frexp (double, int *)
 
float roundf (float)
 
float fmaxf (float, float)
 
float fminf (float, float)
 
int fpclassify (double)
 
double acos (double)
 
double acosh (double)
 
double asin (double)
 
double asinh (double)
 
double atan (double)
 
double atan2 (double, double)
 
double atanh (double)
 
double cbrt (double)
 
double cosh (double)
 
double exp (double)
 
double expm1 (double)
 
double fmax (double, double)
 
double fmin (double, double)
 
double hypot (double, double)
 
double log (double)
 
double log10 (double)
 
double log1p (double)
 
double log2 (double)
 
long lrint (double)
 
double round (double)
 
double sinh (double)
 
double tanh (double)
 
double trunc (double)
 

Macro Definition Documentation

◆ FP_INFINITE

#define FP_INFINITE   1

◆ FP_NAN

#define FP_NAN   4

◆ FP_NORMAL

#define FP_NORMAL   2

◆ FP_SUBNORMAL

#define FP_SUBNORMAL   3

◆ FP_ZERO

#define FP_ZERO   0

◆ fpclassify

#define fpclassify (   x)    (ns_fpclassify_pattern(x))

◆ HUGE_VAL

#define HUGE_VAL   ((double)__builtin_huge_val())

◆ HUGE_VALF

#define HUGE_VALF   ((float)__builtin_huge_valf())

◆ INFINITY

#define INFINITY   ((float)__builtin_inff() + 0.0)

◆ isfinite

#define isfinite (   x)    (ns_fpclassify_pattern(x) != FP_NAN && ns_fpclassify_pattern(x) != FP_INFINITE)

◆ isinf

#define isinf (   x)    (ns_fpclassify_pattern(x) == FP_INFINITE)

◆ isnan

#define isnan (   x)    (ns_fpclassify_pattern(x) == FP_NAN)

◆ isnormal

#define isnormal (   x)    (ns_fpclassify_pattern(x) == FP_NORMAL)

◆ M_1_PI

#define M_1_PI   0.31830988618379067154

◆ M_2_PI

#define M_2_PI   0.63661977236758134308

◆ M_2_SQRTPI

#define M_2_SQRTPI   1.12837916709551257390

◆ M_E

#define M_E   2.7182818284590452354

◆ M_LN10

#define M_LN10   2.30258509299404568402

◆ M_LN2

#define M_LN2   0.69314718055994530942

◆ M_LOG10E

#define M_LOG10E   0.43429448190325182765

◆ M_LOG2E

#define M_LOG2E   1.4426950408889634074

◆ M_PI

#define M_PI   3.14159265358979323846

◆ M_PI_2

#define M_PI_2   1.57079632679489661923

◆ M_PI_4

#define M_PI_4   0.78539816339744830962

◆ M_SQRT1_2

#define M_SQRT1_2   0.70710678118654752440

◆ M_SQRT2

#define M_SQRT2   1.41421356237309504880

◆ NAN

#define NAN   ((float)__builtin_nanf("") + 0.0)

Function Documentation

◆ acos()

double acos ( double  x)

◆ acosf()

float acosf ( float  x)

◆ acosh()

double acosh ( double  x)

◆ asin()

double asin ( double  x)

◆ asinh()

double asinh ( double  x)

◆ atan()

double atan ( double  x)

◆ atan2()

double atan2 ( double  y,
double  x 
)

◆ atan2f()

float atan2f ( float  y,
float  x 
)

◆ atanf()

float atanf ( float  x)

◆ atanh()

double atanh ( double  x)

◆ cbrt()

double cbrt ( double  x)

◆ ceil()

double ceil ( double  d)

math.h shim for the QuickJS port on XenevaOS.

XEClib's real math.h declares only a subset of double libm calls; the rest live in port/libm.c (filling the double-precision gap on top of XEClib's float primitives). quickjs.c needs correct prototypes for all of them plus INFINITY/NAN/signbit – so the QuickJS port build resolves <math.h> to this header instead (include order puts Ports/quickjs/port first for this library only).

Double libm for the QuickJS port.

XEClib ships sin, cos, tan, sqrt, pow, fabs, floor, ceil, fmod, and frexp. QuickJS also calls the functions below. This file is what produces the object; nothing here is a checked-in binary.

◆ ceilf()

float ceilf ( float  x)

◆ cos()

double cos ( double  radians)

◆ cosf()

float cosf ( float  radians)

◆ cosh()

double cosh ( double  x)

◆ exp()

double exp ( double  x)

◆ expm1()

double expm1 ( double  x)

◆ fabs()

double fabs ( double  x)

◆ fabsf()

float fabsf ( float  x)

◆ floor()

double floor ( double  d)

◆ floorf()

float floorf ( float  d)

◆ fmax()

double fmax ( double  x,
double  y 
)

◆ fmaxf()

float fmaxf ( float  a,
float  b 
)

◆ fmin()

double fmin ( double  x,
double  y 
)

◆ fminf()

float fminf ( float  a,
float  b 
)

◆ fmod()

double fmod ( double  x,
double  y 
)

◆ fmodf()

float fmodf ( float  x,
float  y 
)

◆ fpclassify()

int fpclassify ( double  x)

◆ frexp()

double frexp ( double  x,
int *  exp 
)

◆ hypot()

double hypot ( double  x,
double  y 
)

◆ log()

double log ( double  x)

◆ log10()

double log10 ( double  x)

◆ log1p()

double log1p ( double  x)

◆ log2()

double log2 ( double  x)

◆ lrint()

long lrint ( double  x)

◆ modf()

double modf ( double  x,
double *  pint 
)

◆ pow()

double pow ( double  x,
double  y 
)

◆ round()

double round ( double  x)

◆ roundf()

float roundf ( float  x)

◆ sin()

double sin ( double  radians)

◆ sinf()

float sinf ( float  radians)

◆ sinh()

double sinh ( double  x)

◆ sqrt()

double sqrt ( double  y)

◆ sqrtf()

float sqrtf ( float  x)

◆ tan()

double tan ( double  radians)

◆ tanf()

float tanf ( float  radians)

◆ tanh()

double tanh ( double  x)

◆ trunc()

double trunc ( double  x)