cancel
Showing results for 
Search instead for 
Did you mean: 

kdb+ summing

jlucid
Contributor

What algorithm is used in kdb+ for adding floating point numbers, when we run sum or sums?

Is it simple adding the values up in order?

I am looking for something that will minimise precision error, something like 

https://en.wikipedia.org/wiki/Kahan_summation_algorithm

 

1 ACCEPTED SOLUTION

megan_mcp
Community Manager Community Manager
Community Manager

Hi @jlucid,

Here's a link to Float Precision on our website https://code.kx.com/q/basics/precision/#q-simd-sum.

Hope this helps!

Megan

View solution in original post

2 REPLIES 2

megan_mcp
Community Manager Community Manager
Community Manager

Hi @jlucid,

Here's a link to Float Precision on our website https://code.kx.com/q/basics/precision/#q-simd-sum.

Hope this helps!

Megan

Perfect, that was the exact info I was looking for, thanks