mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Added sqrtf
This commit is contained in:
parent
c04c544470
commit
42e10dc2b1
@ -642,6 +642,24 @@ char *reverse(char *Buffer, int i, int j)
|
|||||||
return Buffer;
|
return Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float sqrtf(float x)
|
||||||
|
{
|
||||||
|
if (x < 0.0f)
|
||||||
|
return NAN;
|
||||||
|
|
||||||
|
if (x < 1e-7f)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
|
float guess = x / 2.0f;
|
||||||
|
for (short i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
if (guess == 0.0f)
|
||||||
|
return 0.0f;
|
||||||
|
guess = (guess + x / guess) / 2.0f;
|
||||||
|
}
|
||||||
|
return guess;
|
||||||
|
}
|
||||||
|
|
||||||
char *strtok(char *src, const char *delim)
|
char *strtok(char *src, const char *delim)
|
||||||
{
|
{
|
||||||
static char *src1;
|
static char *src1;
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
#define NAN (__builtin_nanf(""))
|
||||||
|
|
||||||
int isdigit(int c);
|
int isdigit(int c);
|
||||||
int isspace(int c);
|
int isspace(int c);
|
||||||
int isempty(char *str);
|
int isempty(char *str);
|
||||||
@ -15,6 +17,8 @@ extern "C"
|
|||||||
void swap(char *x, char *y);
|
void swap(char *x, char *y);
|
||||||
char *reverse(char *Buffer, int i, int j);
|
char *reverse(char *Buffer, int i, int j);
|
||||||
|
|
||||||
|
float sqrtf(float x);
|
||||||
|
|
||||||
void backspace(char s[]);
|
void backspace(char s[]);
|
||||||
void append(char s[], char n);
|
void append(char s[], char n);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user