mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Numeric ToString/Parse fixes
This commit is contained in:
parent
f1eca07510
commit
9ca48c26f2
4 changed files with 43 additions and 0 deletions
|
@ -959,6 +959,21 @@ static int ToString(float d, char* outStr)
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((len == 3) && (outStr[0] == 'i'))
|
||||
{
|
||||
strcpy(outStr, "Infinity");
|
||||
return 8;
|
||||
}
|
||||
if ((len == 4) && (outStr[0] == '-') && (outStr[1] == 'i'))
|
||||
{
|
||||
strcpy(outStr, "-Infinity");
|
||||
return 9;
|
||||
}
|
||||
if ((len == 9) && (outStr[0] == '-') && (outStr[1] == 'n')) //-nan(xxx)
|
||||
{
|
||||
strcpy(outStr, "NaN");
|
||||
return 3;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -993,6 +1008,21 @@ static int ToString(double d, char* outStr)
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((len == 3) && (outStr[0] == 'i'))
|
||||
{
|
||||
strcpy(outStr, "Infinity");
|
||||
return 8;
|
||||
}
|
||||
if ((len == 4) && (outStr[0] == '-') && (outStr[1] == 'i'))
|
||||
{
|
||||
strcpy(outStr, "-Infinity");
|
||||
return 9;
|
||||
}
|
||||
if ((len == 9) && (outStr[0] == '-') && (outStr[1] == 'n')) //-nan(xxx)
|
||||
{
|
||||
strcpy(outStr, "NaN");
|
||||
return 3;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue