# Difference between i/10\*10 and i?

**URL:** <https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149>\
**Category:** Beginners\
**Created:** [November 3, 2018, 5:03am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149 "2018-11-03T05:03:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [November 3, 2018, 5:03am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149/1 "2018-11-03T05:03:37Z")

</div>

These are two codes, that should have the exact same result, but don’t… why?

```auto
 for (int i = 0; i < vectors.length; i++) {
   vectors[i] = new PVector(i%10*10 + 50, i/10*10); 
 }

 for (int i = 0; i < vectors.length; i++) {
   vectors[i] = new PVector(i%10*10 + 50, i); 
 }

```

Where is the difference? Can someone explain to me, why the first creates a “cursiv” grid, while the second one a normal one?

---

<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:** [November 3, 2018, 5:32am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149/2 "2018-11-03T05:32:00Z")

</div>

- [Forum.Processing.org/two/discussions/tagged/division](http://Forum.Processing.org/two/discussions/tagged/division)

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 3, 2018, 6:00am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149/3 "2018-11-03T06:00:46Z")

</div>

try:

```auto
for (int i = 0; i < 20; i++) {
  println("i: "+i+" i/10*10: "+(i/10*10));
// or
// println("i: "+nf(i,2)+" i/10*10: "+nf((i/10*10),2)+" i/10.0*10: "+nf((i/10.0*10),3,1));

}

```

---

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [November 3, 2018, 7:45am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149/4 "2018-11-03T07:45:51Z")

</div>

Well, i actually already set up a grid system with these loops, so i know the different results they produce, but it just didn’t make any sense, thats why i asked 😅

---

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [November 3, 2018, 7:49am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149/5 "2018-11-03T07:49:37Z")

</div>

Thanks^^ didn’t know it wouldn’t convert that automatically, though now it makes sense 😅  
Problematic if you don’t know it, but quite useful if you do 😊
