1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-03 10:07:02 +00:00
cc65/test/float/gccstubs.c

50 lines
627 B
C
Raw Normal View History

#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;
}
2022-07-20 22:51:28 +00:00
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;
}