work on libc64

This commit is contained in:
Prakxo
2023-03-06 08:28:43 +00:00
parent ed41ef92d4
commit 4c8ff8c2a2
17 changed files with 164 additions and 12 deletions
+8
View File
@@ -0,0 +1,8 @@
#ifndef RAND_H
#define RAND_H
#include "types.h"
void srand (u32 seeed);
int rand(void);
#endif
+25
View File
@@ -0,0 +1,25 @@
#ifndef W_MATH_H
#define W_MATH_H
#include "types.h"
inline float sqrtf(float x)
{
static const double _half=.5;
static const double _three=3.0;
volatile float y;
if(x > 0.0f)
{
double guess = __frsqrte((double)x); // returns an approximation to
guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits
guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits
guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits
y=(float)(x*guess);
return y;
}
return x;
}
f64 atan2(f64, f64);
f64 acos(f32);
#endif