I have written the following function for creating tickmarks on the x and y axis. However, I don't understand that why it is not performing well at -0.1 and -0.6.

```
TickMark[Min_, Max_, Inc_] :=
  Table[
   If[
    Mod[IntegerPart[i*10], 10] === 0,
    {IntegerPart[i], IntegerPart[i], .02, Black},
    If[
     Mod[IntegerPart[i*10], 5] === 0,
     {i, i, .02, Black},
     {i, Null, .01, Black}
     ]
    ],
   {i, Floor[Min], Ceiling[Max], Inc}];

xAxis = TickMark[-2, 2, 0.1];

yAxis = TickMark[0, 4, 0.1];

Plot[x^2, {x, -1, 1}, Ticks -> {xAxis, yAxis}]

```

[![enter image description here](https://i.stack.imgur.com/tLKbc.png)](https://i.stack.imgur.com/tLKbc.png)