mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-04-29 20:11:23 +00:00
fixed saving floats on Windows, key conflict on 's'
This commit is contained in:
3
util.cpp
3
util.cpp
@@ -25,7 +25,8 @@ string fts4(float x) { char buf[64]; sprintf(buf, "%6.4f", x); return buf; }
|
||||
string ftssmart(ld x) {
|
||||
if(x == int(x)) return its(int(x));
|
||||
if(abs(x) > 1) return fts4(x);
|
||||
char buf[64]; sprintf(buf, "%.10le", (double) x); return buf;
|
||||
char buf[64]; sprintf(buf, "%.10e", (float) x);
|
||||
return buf;
|
||||
}
|
||||
|
||||
string cts(char c) { char buf[8]; buf[0] = c; buf[1] = 0; return buf; }
|
||||
|
||||
Reference in New Issue
Block a user