mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software/libbase: now that we have double precision, printf hack no longer needed
This commit is contained in:
parent
78d5645236
commit
80f3d83c34
1 changed files with 4 additions and 5 deletions
|
@ -196,12 +196,11 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||||
|
|
||||||
case 'f': {
|
case 'f': {
|
||||||
int m;
|
int m;
|
||||||
float f;
|
double f;
|
||||||
int integer;
|
int integer;
|
||||||
|
|
||||||
/* until I sort out how to disable this stupid promotion to double ... */
|
f = va_arg(args, double);
|
||||||
f = *(va_arg(args, float *));
|
if(f < 0.0) {
|
||||||
if((f <= 0.0f) && (f != 0.0f)) { /* TODO: fix that |[#{'"é! '<' operator */
|
|
||||||
*str = '-';
|
*str = '-';
|
||||||
str++;
|
str++;
|
||||||
f = -f;
|
f = -f;
|
||||||
|
@ -233,7 +232,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||||
for(i=0;i<6;i++) {
|
for(i=0;i<6;i++) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
f = f*10.0f;
|
f = f*10.0;
|
||||||
n = f;
|
n = f;
|
||||||
f = f - n;
|
f = f - n;
|
||||||
if(str >= end) break;
|
if(str >= end) break;
|
||||||
|
|
Loading…
Reference in a new issue