# For loops issue

**URL:** https://discourse.julialang.org/t/for-loops-issue/92227
**Category:** General Usage
**Tags:** question
**Created:** [December 28, 2022, 1:04pm UTC](https://discourse.julialang.org/t/for-loops-issue/92227 "2022-12-28T13:04:03Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [December 28, 2022, 1:13pm UTC](https://discourse.julialang.org/t/for-loops-issue/92227/2 "2022-12-28T13:13:12Z")

</div>

```julia-auto
julia> 1.1 - 2*0.1
0.9000000000000001

```

This is not Julia-specific, it’s due to the fact that [standard floating-point arithmetic](https://en.wikipedia.org/wiki/IEEE_754) doesn’t exactly represent decimal values like `1.1` and `0.1`. For example, in Python 3:

```py
>>> 1.1 - 2*0.1
0.9000000000000001

```

See:

> [@PSA: floating-point arithmetic](https://discourse.julialang.org/t/psa-floating-point-arithmetic/8678):
>
> Sometimes people are surprised by the results of floating-point calculations such as julia\> 5/6 0.8333333333333334 # shouldn't the last digit be 3? julia\> 2.6 - 0.7 - 1.9 2.220446049250313e-16 # shouldn't the answer be 0? These are not bugs in Julia. They’re consequences of the IEEE-standard 64-bit binary representation of floating-point numbers that is burned into computer hardware, which Julia and many other languages use by default. Brief explanation You can t…

---

_[View the full topic](https://discourse.julialang.org/t/for-loops-issue/92227)._
