I know this is simple but I can’t quite see it. In csharp I would have a variable to store the running total, and using a for loop I would iterate through each ‘slice’, adding it’s value to this variable.
How is this done in VL? I wouldn’t have thought you’d need much more than a pad, a +, and a foreach…
+, foreach and an accumulator that stores the sum and passes it on to the next iteration.
there is also the Sum node for sequences (Spread is a Sequence) that does this for you. you can click open to see how the Sum node is patched…
yes, that makes sense, Float32 is not capable of representing integer numbers that high:
Floating point numbers have an insane value range, but its important to understand that there is only a certain number of digits of precision.
This also means that the maximum consecutive integer that can be represented is 2^24 = 16,777,216 for Float32 and 2^54 = 9,007,199,254,740,992 for Float64, keep that in mind when connecting integers to float inputs.