2015-09-01から1ヶ月間の記事一覧
test.d import std.stdio; import std.math; double round(double val) { return floor(((val * 100) + 5) / 10.0) / 10.0; } void main() { writeln(round(1.45)); writeln(round(1.44)); }実行 dmd test.d ./test 結果 1.5 1.4
test.d import std.stdio; import std.math; double round(double val) { return floor(((val * 100) + 5) / 10.0) / 10.0; } void main() { writeln(round(1.45)); writeln(round(1.44)); }実行 dmd test.d ./test 結果 1.5 1.4