# Is there a way to represent small numbers more precisely than float?

**URL:** <https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111>\
**Category:** Beginners\
**Created:** [January 2, 2019, 7:00pm UTC](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111 "2019-01-02T19:00:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olex](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@Olex](https://discourse.processing.org/u/Olex)\
**Post date:** [January 2, 2019, 7:00pm UTC](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111/1 "2019-01-02T19:00:46Z")

</div>

I need high precision for a project i’m working on and regular floats are not enough. Is there a class or type which has a settable precision?

---

<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:** [January 2, 2019, 7:16pm UTC](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111/2 "2019-01-02T19:16:18Z")

</div>

- [Processing.org/reference/double.html](http://Processing.org/reference/double.html)
- [Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html](http://Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html)

---

<div class="post-metadata">

**Author:** ![Olex](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@Olex](https://discourse.processing.org/u/Olex)\
**Post date:** [January 2, 2019, 7:17pm UTC](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111/3 "2019-01-02T19:17:53Z")

</div>

and how do I use bigDecimal in processing?

---

<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:** [January 2, 2019, 7:30pm UTC](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111/4 "2019-01-02T19:30:25Z")

</div>

`import java.math.BigDecimal;`

- [Processing.org/reference/import.html](http://Processing.org/reference/import.html)
