mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-07 01:38:26 +00:00
Add a function to convert a double to a string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d2fdd91c66
commit
2e35bedc82
@ -9,6 +9,7 @@
|
||||
#define LLVM_TOOLS_STRING_EXTRAS_H
|
||||
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include "llvm/Tools/DataTypes.h"
|
||||
|
||||
static inline string utostr(uint64_t X, bool isNeg = false) {
|
||||
@ -60,4 +61,10 @@ static inline string itostr(int X) {
|
||||
return utostr((unsigned)X);
|
||||
}
|
||||
|
||||
static inline string ftostr(double V) {
|
||||
char Buffer[200];
|
||||
snprintf(Buffer, 200, "%f", V);
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user