Price fraction: Difference between revisions
→{{header|langur}}
(Add Swift) |
Langurmonkey (talk | contribs) |
||
Line 1,822:
Langur uses decimal floating point.
<lang langur>
val .pricefrac = f given .f {
/* The default operator between test cases is "and".
case >= 0.00, < 0.06: 0.10▼
That is, writing "case" without a logical operator is the same as writing "case and".
case >= 0.06, < 0.11: 0.18▼
To make a given case
case >= 0.16, < 0.21: 0.32▼
case >= 0.21, < 0.26: 0.38▼
case >= 0.76, <
▲ }
default: throw "bad data"
}
|