# Unable to generate proper float value in Processing

**URL:** https://discourse.processing.org/t/unable-to-generate-proper-float-value-in-processing/29352
**Category:** Beginners
**Created:** [April 13, 2021, 11:55pm UTC](https://discourse.processing.org/t/unable-to-generate-proper-float-value-in-processing/29352 "2021-04-13T23:55:08Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [April 14, 2021, 12:04am UTC](https://discourse.processing.org/t/unable-to-generate-proper-float-value-in-processing/29352/2 "2021-04-14T00:04:00Z")

</div>

At least 1 of the variables _i_ or _n_ needs to be of datatype `float` for the operator `/` to evaluate its operands as a `float` value. 🧐

Alternatively you can temporarily upcast 1 of the variables to `float`:  
`float k = kMax * sqrt( (float) i / n );`

---

_[View the full topic](https://discourse.processing.org/t/unable-to-generate-proper-float-value-in-processing/29352)._
