Tutorials/The Basics/Solutions

From Kx Wiki
Jump to: navigation, search

1. Can you do it in less characters than this?

q)3*100*(2+5)%24+38*2
21f

Why does my result have an f after it? This indicates the datatype “float”, which is always returned by division %. We’ll see more about datatypes in the next tutorial.

2. This exercise demonstrates why there is almost never a need to write loops in your q code.

q)d+d*2
3 12 24 6 27
q)e:d+1
q)e*e
4 25 81 9 100
q)d,e
1 4 8 2 9 2 5 9 3 10

Back to Tutorials

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox