Follow

What is CS0664?

Symptoms

  • When trying to enter play mode, I am receiving the error below:
error CS0664: Literal of type double cannot be implicitly converted to type `float'. Add suffix `f' to create a literal of this type

Cause

The CS0664 error is caused when a number with a decimal place is entered when declaring a float but does not include the`f' suffix. Please see the example below.

Resolution

The error CS0664 is resolved by adding the `f' suffix to the end of the value that you are assigning to the float. See the example below.

 

More Information

For more information please read https://msdn.microsoft.com/en-us/library/h9w1wc66.aspx

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.