# 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:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [December 1, 2022, 12:40am UTC](https://boards.straightdope.com/t/floating-point-madness/975770/28 "2022-12-01T00:40:58Z")

</div>

> [@pulykamell](#):
>
> Stupid question – can we not multiply everything by 100 (and cast as an INT?) and then, with the final calculation complete, divide by a hundred?

This has its own issues.

Take N. Divide it by a million. Multiply the result by a million. You should get N. Instead you’ll likely get 0.

You have to be careful doing math in a computer, no matter what format your data is in and what operations you are doing.

---

_[View the full topic](https://boards.straightdope.com/t/floating-point-madness/975770)._
