mirror of
https://github.com/cc65/cc65.git
synced 2024-09-08 16:54:52 +00:00
50 lines
627 B
C
50 lines
627 B
C
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
float _fneg(float f)
|
|
{
|
|
return f * -1.0f;
|
|
}
|
|
|
|
float _fand(float f1, float f2)
|
|
{
|
|
return ((unsigned)f1) & ((unsigned)f2);
|
|
}
|
|
|
|
char buffer[32];
|
|
|
|
char *_ftostr(char *d, float s)
|
|
{
|
|
if (d == NULL) {
|
|
d = &buffer[0];
|
|
}
|
|
sprintf(d, "%f", (double)s);
|
|
return d;
|
|
}
|
|
|
|
char *_ftoa(char *d, float s)
|
|
{
|
|
if (d == NULL) {
|
|
d = &buffer[0];
|
|
}
|
|
sprintf(d, "%f", (double)s);
|
|
return d;
|
|
}
|
|
|
|
float _ctof(char c)
|
|
{
|
|
return (float)c;
|
|
}
|
|
|
|
float _utof(unsigned int c)
|
|
{
|
|
return (float)c;
|
|
}
|
|
|
|
float _stof(signed int c)
|
|
{
|
|
return (float)c;
|
|
}
|