Price fraction: Difference between revisions

 
Line 3,236:
Langur uses decimal floating point.
 
<syntaxhighlight lang="langur">val .pricefrac = fn(.f) { switch[and] .f {
case >= 0.00, < 0.06: 0.10
case >= 0.06, < 0.11: 0.18
Line 3,258:
case >= 0.96, <= 1.00: 1.00
default: throw "bad data"
}}
 
writeln .pricefrac(0.17)
890

edits