How do I typecast a double to a float ?

Sorry for this question, I really am a total noob.

I have this line of code

Surface = StartCell+Mathf.Sin((ff+aa)*1.8/XCells)*150

Where all the variables are integers. I get an error saying it cannot convert double to float, which I guess is what the Sin function needs as an argument.

I tried

Surface = StartCell+Mathf.Sin(float((ff+aa)*1.8/XCells))*150

but it didn’t work.

I have the same problem with :

short Height = Random.Range(0,300)

since Random.Range returns an int

Thank you for your help
Tabc3dd

is like this:

(float)(expression/function which returns int)

Thanks, however I can’t seem to make it work. To test I made a really simple line :

aa += Mathf.Sin((float) 3);

and I get the error

Cannot implicitly convert type float' to int’. An explicit conversion exists (are you missing a cast?)

What am I doing wrong ?

Edit : Oh god, I really am stupid. I found out, sorry ^^’

Edit2 : Thanks once again

glad I could help you.