# ArithmeticException: / by zero

**URL:** <https://discourse.processing.org/t/arithmeticexception-by-zero/16525>\
**Category:** Beginners\
**Created:** [December 19, 2019, 7:50pm UTC](https://discourse.processing.org/t/arithmeticexception-by-zero/16525 "2019-12-19T19:50:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unique\_username](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@unique\_username](https://discourse.processing.org/u/unique_username)\
**Post date:** [December 19, 2019, 7:50pm UTC](https://discourse.processing.org/t/arithmeticexception-by-zero/16525/1 "2019-12-19T19:50:11Z")

</div>

Hello. I’ve been working on a new project, which has been going splendidly for me as I thought it would be quite a challenge, but it has been a breeze so far. I was then adding a new element and the first of this element worked fine. The second one, however, returned the error shown in the title.  
I know I didn’t divide by zero, though. So what’s going on?

```auto
   if(battletriangle2x<width/(2/3)) {

```

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 19, 2019, 11:09pm UTC](https://discourse.processing.org/t/arithmeticexception-by-zero/16525/2 "2019-12-19T23:09:00Z")

</div>

Try (2.0/3) instead of (2/3)

---

<div class="post-metadata">

**Author:** ![unique\_username](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@unique\_username](https://discourse.processing.org/u/unique_username)\
**Post date:** [December 19, 2019, 11:14pm UTC](https://discourse.processing.org/t/arithmeticexception-by-zero/16525/3 "2019-12-19T23:14:49Z")

</div>

Thanks. That worked.
