Anonymous user
Price fraction: Difference between revisions
Updated D entry
(Updated D entry) |
|||
Line 584:
=={{header|D}}==
<lang d>import std.stdio
double priceRounder(in double price) pure nothrow
in {
enum cin = [.06, .11, .16, .21, .26, .31, .36, .41, .46, .51,▼
enum cin =
enum cout =
foreach (i,
if (p >=
}
void main() {
Line 603 ⟶ 604:
writeln(priceRounder(price));
}</lang>
{{out}}
<pre>0.82
0.9
|