2020.07.29 05:04 PM
Hi,Masters:
I have a task to calculate a value, which includes 2variables and should be implemented with recursion restate.
The formula is simple: Fn = Fn-1 * 2+ An (Given conditions:F0 = 10, A = 1 + til 5)
I implemented the part of “Fn =Fn-1 * 2“ in Q with “5 {x * 2}\ 10”, but I was blocked with the secondvariable. Do you have any comment? Appreciate for you advice.
Thanks
hzadonis
2020.07.30 08:57 PM
2020.07.30 11:31 PM
given function 'f' defined as:f:{[F;A]A+F*2}does this meet your requirement?q)f\[10;til 5]
20 41 84 171 346
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.