mirror of
https://github.com/cc65/cc65.git
synced 2024-11-02 18:06:48 +00:00
51 lines
660 B
C
51 lines
660 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];
|
|
}
|
|
// printf("<%f>", (double)s);
|
|
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;
|
|
}
|