# Floating point madness

**URL:** <https://boards.straightdope.com/t/floating-point-madness/975770>\
**Category:** Factual Questions\
**Created:** [November 30, 2022, 1:38am UTC](https://boards.straightdope.com/t/floating-point-madness/975770 "2022-11-30T01:38:31Z")\
**Posts on this page:** 2\
**Page:** 3

<div class="post-metadata">

**Author:** ![bryanmaguire](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@bryanmaguire](https://boards.straightdope.com/u/bryanmaguire)\
**Post date:** [December 5, 2022, 11:22am UTC](https://boards.straightdope.com/t/floating-point-madness/975770/41 "2022-12-05T11:22:49Z")

</div>

That is it. When I created the cell with the SUM it set the format of that cell to the format of the cells summed. so the first cell has General format. The second SUM cell has has number format with 2 places of decimal.

---

<div class="post-metadata">

**Author:** ![glowacks](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/glowacks/32/5548_2.png) [@glowacks](https://boards.straightdope.com/u/glowacks)\
**Post date:** [December 18, 2022, 12:17am UTC](https://boards.straightdope.com/t/floating-point-madness/975770/42 "2022-12-18T00:17:05Z")

</div>

> [@LSLGuy](#):
>
> Many of us could solve your problem correctly, once we have the requisite info.

There wasn’t an actual problem that needed solving here; I was just wondering why different versions of Excel and different spreadsheets were giving different answers when affected by floating-point imprecision, that’s all I cared about, and that was answered relatively early.

As to what the numbers represent, that’s totally irrelevant to the question.

> [@LSLGuy](#):
>
> Most likely all this is way above the OP’s head, but if they want a correct answer every time, they need to have a process that’s correct by design, not one that gets lucky via rounding most of the time.

Please don’t assume what is or is not over my head. I might be working as an accountant, but I got a BA and MA in mathematics before bailing on academia.

I don’t have a problem getting correct answers either. The fact that these numbers came from something I was working on was totally irrelevant. They were only to frame the question I was posing. There is nothing special about the numbers other than that they are the ones that I used for the question because they generated a different wrong floating-point answer depending on where the calculation was done. Your concern for my troubles is entirely misplaced. There was no trouble at all here, just curiosity as to what was going on with floating point, which I now understand a bit better thanks to some of the answers previously.

[Previous page](https://boards.straightdope.com/t/floating-point-madness/975770.md?page=2)
