Price fraction: Difference between revisions

Rename variable
mNo edit summary
(Rename variable)
Line 2,234:
const func float: computePrice (in float: x) is func
result
var float: resultprice is 0.0;
begin
if x >= 0.0 and x < 0.06 then
resultprice := 0.10;
elsif x < 0.11 then
resultprice := 0.18;
elsif x < 0.36 then
resultprice := flt(((trunc(x * 100.0) - 11) div 5) * 6 + 26) / 100.0;
elsif x < 0.96 then
resultprice := flt(((trunc(x * 100.0) - 31) div 5) * 4 + 50) / 100.0;
else
resultprice := 1.0;
end if;
end func;
Line 2,267:
const func float: computePrice (in float: x) is func
result
var float: resultprice is 0.0;
local
var integer: index is 1;
Line 2,275:
incr(index);
end while;
resultprice := table[index][2];
else
raise RANGE_ERROR;