mirror of https://github.com/flysand7/ciabatta.git
35 lines
408 B
C
35 lines
408 B
C
|
|
#include <math.h>
|
|
|
|
double fabs(double x) {
|
|
if(x >= 0) {
|
|
return x;
|
|
}
|
|
return -x;
|
|
}
|
|
|
|
float fabsf(float x) {
|
|
if(x >= 0) {
|
|
return x;
|
|
}
|
|
return -x;
|
|
}
|
|
|
|
double fmod(double x, double y) {
|
|
int n = 0;
|
|
while(y < x*n) {
|
|
++n;
|
|
}
|
|
return y - n*x;
|
|
}
|
|
|
|
float fmodf(float x, float y) {
|
|
int n = 0;
|
|
while(y < x*n) {
|
|
++n;
|
|
}
|
|
return y - n*x;
|
|
}
|
|
|
|
|