3 ms·
>tricks like if you are going to add up an array of floating point numbers, you need to sort them first. ...I think you'll want to use a priority queue, with t
by GregBuchholz 12y ago
>tricks like if you are going to add up an array of floating point numbers, you need to sort them first.
...I think you'll want to use a priority queue, with the smallest numbers on top, adding the first two, and then pushing the result back onto the priority queue. Repeat until you only have one item left.
- the_one_smiley 12y agoThe number of people who add up arrays of floating point numbers and don't know about Kahan summation is really incredible.