A static_cast converts to expression inside the parentheses to the datatype inside the brackets. You may be seeing it used in division to force floating point division in some cases.
If you are having trouble with code that is using it, you could post the snippet and we could try to explain what's wrong.
i think that it depends on diameter variable. If it is either int or double.
If diameter is an int then lets say: double radius = 2/3;
2/3 should result in 0,6666666666666667 but since both these number are int it would be rounded down to 0. Then int 0 would be assigned to double radius.
The .0 tells the compiler that it's a double literal rather than a signed integer (some lazy people don't bother with the 0, but I think that's less readable, esp. when scanning code fast.)