Jump to content

Price fraction: Difference between revisions

→‎version 2: optimized
(Added F# version)
(→‎version 2: optimized)
Line 2,231:
* Inspired by some other solutions tested with version 1 (above)
* 20.04.2013 Walter Pachl
* 03.11.2013 -"- move r. computation (once is enough)
**********************************************************************/
rl='0.10 0.18 0.26 0.32 0.38 0.44 0.50 0.54 0.58 0.62',
'0.66 0.70 0.74 0.78 0.82 0.86 0.90 0.94 0.98 1.00'
Do i=1 To 20
Parse Var rl r.i rl
End
Do x=0 To 1 By 0.01
old=adjprice(x)
Line 2,241 ⟶ 2,247:
Exit
 
adjprice2: Procedure Expose r.
i=((100*parg(1)-1)%5+1)
rl='0.10 0.18 0.26 0.32 0.38 0.44 0.50 0.54 0.58 0.62',
'0.66 0.70 0.74 0.78 0.82 0.86 0.90 0.94 0.98 1.00'
Do i=1 To 20
Parse Var rl r.i rl
End
Parse Arg p
i=((100*p-1)%5+1)
Return r.i</lang>
 
2,295

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.