finix/libk/include/math.h

63 lines
1.3 KiB
C
Raw Normal View History

2023-07-16 06:54:32 +00:00
#pragma once
#define PI 3.14159265358979323846
#define E 0.57721566490153286060
#define NAN 0x7ff8000000000000
#define INFINITY 0x7ff0000000000000
#define NEG_INFINITY 0xfff0000000000000
double frexp(double arg, int* exp);
float frexpf(float arg, int* exp);
double sqrt(double num);
float sqrtf(float num);
double pow(double num, double raise);
float powf(float num, float raise);
#define exp(x) pow(E, x)
#define expf(x) powf(E, x)
double fabs(double num);
float fabsf(float num);
double floor(double x);
float floorf(float x);
double ceil(double x);
float ceilf(float x);
double fma(double x, double y, double z);
float fmaf(float x, float y, float z);
double copysign(double n, double s);
float copysignf(float n, float s);
double fmod(double x, double y);
float fmodf(float x, float y);
double fclamp(double x, double l, double h);
float fclampf(float x, float l, float h);
#define isnan(n) (n == NAN)
#define isinf(n) (n == INFINITY)
double sin(double r);
double cos(double r);
double tan(double r);
double csc(double r);
double sec(double r);
double cot(double r);
double sinh(double r);
double cosh(double r);
double tanh(double r);
double csch(double r);
double sech(double r);
double coth(double r);
unsigned long long fact(unsigned int num);