XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions
math.h File Reference
#include <_xeneva.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  float_bits_t
 
union  double_bits_t
 

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 EXTRACT_WORDS(hi, lo, d)
 
#define GET_HIGH_WORD(hi, d)
 
#define GET_LOW_WORD(lo, d)
 
#define INSERT_WORDS(d, hi, lo)
 
#define SET_HIGH_WORD(d, hi)    INSERT_WORDS(d, hi, (uint32_t)asuint64(d))
 
#define SET_LOW_WORD(d, lo)    INSERT_WORDS(d, asuint64(d)>>32, lo)
 
#define GET_FLOAT_WORD(w, d)
 
#define SET_FLOAT_WORD(d, w)
 
#define isfinite(x)   ((fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE))
 
#define isnormal(x)   (fpclassify(x) == FP_NORMAL)
 
#define isnan(x)   (fpclassify(x) == FP_NAN)
 
#define isinf(x)   (fpclassify(x) == FP_INFINITE)
 
#define FORCE_EVAL(x)
 

Enumerations

enum  {
  FP_NAN , FP_INFINITE , FP_ZERO , FP_SUBNORMAL ,
  FP_NORMAL
}
 

Functions

XE_LIB int fpclassify (double x)
 
XE_LIB double ceil (double)
 
XE_LIB float ceilf (float x)
 
XE_LIB double cos (double)
 
XE_LIB float acosf (float x)
 
XE_LIB float cosf (float)
 
XE_LIB double fabs (double)
 
XE_LIB float fabsf (float)
 
XE_LIB double floor (double)
 
XE_LIB float floorf (float)
 
XE_LIB double fmod (double, double)
 
XE_LIB double modf (double, double *)
 
XE_LIB float fmodf (float x, float y)
 
XE_LIB double pow (double, double)
 
XE_LIB double sin (double)
 
XE_LIB float sinf (float)
 
XE_LIB double sqrt (double)
 
XE_LIB float sqrtf (float x)
 
XE_LIB double tan (double)
 
XE_LIB float tanf (float)
 
XE_LIB float atanf (float x)
 
XE_LIB float atan2f (float y, float x)
 
XE_LIB double frexp (double x, int *exp)
 
XE_LIB float roundf (float x)
 

Macro Definition Documentation

◆ EXTRACT_WORDS

#define EXTRACT_WORDS (   hi,
  lo,
 
)
Value:
do { \
uint64_t __u = asuint64(d); \
(hi) = __u >> 32; \
(lo) = (uint32_t)__u; \
} while (0)
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165

◆ FORCE_EVAL

#define FORCE_EVAL (   x)
Value:
do { \
if (sizeof(x) == sizeof(float)){ \
_KePrint("Evaluating float \r\n"); \
fp_force_evalf(x); \
}else if (sizeof(x) == sizeof(double)) { \
_KePrint("FORCE EVAL double \r\n"); \
fp_force_eval(x); \
} else { \
_KePrint("Force eval long \r\n"); \
fp_force_evall(x); \
} \
}while(0)

◆ GET_FLOAT_WORD

#define GET_FLOAT_WORD (   w,
 
)
Value:
do { \
(w) = asuint(d); \
} while (0)

◆ GET_HIGH_WORD

#define GET_HIGH_WORD (   hi,
 
)
Value:
do { \
(hi) = asuint64(d) >> 32; \
} while (0)

◆ GET_LOW_WORD

#define GET_LOW_WORD (   lo,
 
)
Value:
do { \
(lo) = (uint32_t)asuint64(d); \
} while (0)

◆ INSERT_WORDS

#define INSERT_WORDS (   d,
  hi,
  lo 
)
Value:
do { \
(d) = asdouble(((uint64_t)(hi)<<32) | (uint32_t)(lo)); \
} while (0)

◆ isfinite

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

◆ isinf

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

◆ isnan

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

◆ isnormal

#define isnormal (   x)    (fpclassify(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

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ 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

◆ SET_FLOAT_WORD

#define SET_FLOAT_WORD (   d,
 
)
Value:
do { \
(d) = asfloat(w); \
} while (0)

◆ SET_HIGH_WORD

#define SET_HIGH_WORD (   d,
  hi 
)     INSERT_WORDS(d, hi, (uint32_t)asuint64(d))

◆ SET_LOW_WORD

#define SET_LOW_WORD (   d,
  lo 
)     INSERT_WORDS(d, asuint64(d)>>32, lo)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FP_NAN 
FP_INFINITE 
FP_ZERO 
FP_SUBNORMAL 
FP_NORMAL 

Function Documentation

◆ acosf()

XE_LIB float acosf ( float  x)

◆ atan2f()

XE_LIB float atan2f ( float  y,
float  x 
)

◆ atanf()

XE_LIB float atanf ( float  x)

◆ ceil()

XE_LIB double ceil ( double  d)

◆ ceilf()

XE_LIB float ceilf ( float  x)

◆ cos()

XE_LIB double cos ( double  radians)

◆ cosf()

XE_LIB float cosf ( float  radians)

◆ fabs()

XE_LIB double fabs ( double  x)

◆ fabsf()

XE_LIB float fabsf ( float  x)

◆ floor()

XE_LIB double floor ( double  d)

◆ floorf()

XE_LIB float floorf ( float  d)

◆ fmod()

XE_LIB double fmod ( double  x,
double  y 
)

◆ fmodf()

XE_LIB float fmodf ( float  x,
float  y 
)

◆ fpclassify()

XE_LIB int fpclassify ( double  x)

◆ frexp()

XE_LIB double frexp ( double  x,
int *  exp 
)

◆ modf()

XE_LIB double modf ( double  x,
double *  pint 
)

◆ pow()

XE_LIB double pow ( double  x,
double  y 
)

◆ roundf()

XE_LIB float roundf ( float  x)

◆ sin()

XE_LIB double sin ( double  radians)

◆ sinf()

XE_LIB float sinf ( float  radians)

◆ sqrt()

XE_LIB double sqrt ( double  y)

◆ sqrtf()

XE_LIB float sqrtf ( float  x)

◆ tan()

XE_LIB double tan ( double  radians)

◆ tanf()

XE_LIB float tanf ( float  radians)