# Whats the deal in USA with 1 litre soda pop, is USA on metric?

**URL:** <https://boards.straightdope.com/t/whats-the-deal-in-usa-with-1-litre-soda-pop-is-usa-on-metric/124825>\
**Category:** Factual Questions\
**Created:** [August 21, 2002, 1:23am UTC](https://boards.straightdope.com/t/whats-the-deal-in-usa-with-1-litre-soda-pop-is-usa-on-metric/124825 "2002-08-21T01:23:23Z")\
**Posts on this page:** 1\
**Showing post:** 108

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [July 30, 2017, 2:02am UTC](https://boards.straightdope.com/t/whats-the-deal-in-usa-with-1-litre-soda-pop-is-usa-on-metric/124825/108 "2017-07-30T02:02:30Z")

</div>

> [@DPRK](#):
>
> Btw [here](https://en.wikipedia.org/wiki/Kahan_summation_algorithm) is one proper algorithm for adding finite-precision decimal numbers. It can be done.

Kahan summation isn’t really related to the non-binariness of ten — if that’s your concern, just multiple all your “mils” (or whatever) by 1000 and work with integers.

But Kahan summation is a beautiful little method! I am perfectionistic enough that I use Kahan’s method, e.g. when calculating statistical moments. One big caveat for the C programmer:

```auto

/* Do NOT compile this with any compiler optimization !
 * The optimizer would "figure out" that kp->carry is being set to zero
 * and eliminate the essence of the method!
 */
double kahan_add(double addend, struct Floatsum *kp)
{
        double y = addend - kp->carry;
        double tmp = kp->sum + y;
        kp->carry = (tmp - kp->sum) - y;
        kp->sum = tmp;
        return kp->sum + kp->carry;
}

```

---

_[View the full topic](https://boards.straightdope.com/t/whats-the-deal-in-usa-with-1-litre-soda-pop-is-usa-on-metric/124825)._
