# Type error creating R gate in Q#?

The R operation in Q# is listed by Microsoft in the documentation as follows

operation R (pauli : Pauli, theta : Double, qubit : Qubit) : Unit

However, when I try to use the following command in a Q# operation,

R(PauliX,0,Q1);

I get an error, referencing the line of code for the R command:

The type of the given argument does not match the expected type.

Q1 is of course a Qubit, so I don't see what could be causing the problem. I've also been having difficulty getting the R1 gate working, but I suspect for similar reasons.

To see the relevant documentation, please visit R operation, Q# Docs.

The second argument theta has to be a Double, and 0 is a constant of type Int. Q# doesn't have implicit type casting, so you need to make sure your second argument is a Double. If you're looking for a rotation by zero angle, you'll need to do R(PauliX, 0.0, Q1);. Alternatively, you can use ToDouble to cast an integer parameter to a Double.