# For some reason some math results in 0

**URL:** https://discourse.processing.org/t/for-some-reason-some-math-results-in-0/949
**Category:** Processing
**Created:** [June 14, 2018, 7:52am UTC](https://discourse.processing.org/t/for-some-reason-some-math-results-in-0/949 "2018-06-14T07:52:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)
#### Post date: [June 14, 2018, 7:52am UTC](https://discourse.processing.org/t/for-some-reason-some-math-results-in-0/949/1 "2018-06-14T07:52:22Z")

</div>

So I am trying to calculate pi (don’t ask), I have a variable, P, which when two random numbers _don’t_ share a common factor, it goes up. Then I divide by the amount of times I do that. The problem is, when doing something like dividing it by 100 (when it is 64), it results a 0. Any help?

-Grim

---

<div class="post-metadata">

### Author: ![colin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/colin/32/230_2.png) [@colin](https://discourse.processing.org/u/colin)
#### Post date: [June 14, 2018, 8:05am UTC](https://discourse.processing.org/t/for-some-reason-some-math-results-in-0/949/2 "2018-06-14T08:05:37Z")

</div>

Hi @Grimtin10 😌  
Are you sure the variables you’re dividing are float ?  
This happened to me so many times …

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [June 14, 2018, 8:14am UTC](https://discourse.processing.org/t/for-some-reason-some-math-results-in-0/949/3 "2018-06-14T08:14:07Z")

</div>

`64 / 100 = 0`

`64.0 / 100.0 = 0.64`

---

<div class="post-metadata">

### Author: ![Grimtin10](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Grimtin10](https://discourse.processing.org/u/Grimtin10)
#### Post date: [June 14, 2018, 8:17am UTC](https://discourse.processing.org/t/for-some-reason-some-math-results-in-0/949/4 "2018-06-14T08:17:29Z")

</div>

oh. that makes sense
