mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
change the floating point printing format to be more concise. It wouldn't surprise me if this
wasn't perfect, but it is close enough for now. We now print 4.0 instead of 4.000000. Swift SVN r1558
This commit is contained in:
@@ -339,7 +339,11 @@ extern "C" void _TSs5printFT3valNSs5Int64_T_(int64_t l) {
|
||||
}
|
||||
|
||||
extern "C" void _TSs5printFT3valNSs6Double_T_(double l) {
|
||||
printf("%f", l);
|
||||
char Buffer[256];
|
||||
sprintf(Buffer, "%g", l);
|
||||
if (llvm::StringRef((char*)Buffer).find_first_of(".e") == llvm::StringRef::npos)
|
||||
strcat(Buffer, ".0");
|
||||
printf("%s", Buffer);
|
||||
}
|
||||
|
||||
extern "C" void _TSs9printCharFT9characterNSs5Int32_T_(int32_t l) {
|
||||
|
||||
Reference in New Issue
Block a user