How to use decimal values?

Instead of x equalling to 1, is there a way to make x equal to 1.75? I looked at float on the reference page but couldn't quite make sense of it. Can anyone help please?

void loop()
{
   int x = 1;
   for (int i = 0; i > -1; i = i + x){
      analogWrite(PWMpin, i);
      if (i == 255) x = -1;             // switch direction at peak
      delay(10);
   } 
}

In respect of analogWrite, your question doesn't make sense, because it only accepts integer values.

What are you trying to do?

You probably want to revise your understanding of for loops too.

      if (i == 255) x = -1;             // switch direction at peak

How does changing x to 1.75 or -1.75 make sense?

Incrementing an integer by 1.75 or -1.75 will produce exactly the same result as incrementing by 1 or -1.

Incrementing a float, on the other hand, will produce different results. Of course, that means that BOTH i and x need to be of type float.

My bad, forget that example then. Basically increase the speed and decrease the speed of a motor but at a decimal value but not a whole number if that's possible?

Can you please explain why the increment should be a fraction, and not a whole number?

You don't understand what you are doing - you change the delay value to change the rate of ramping.
Try delay (6) instead.

Incrementing a float, on the other hand, will produce different results. Of course, that means that BOTH i and x need to be of type float.

How do I do this?

LPDE:
How do I do this?

Using a text editor comes to mind.