For a number of reasons, I should use float in my code instead of two-local ones. To use a literal in my code, I have to write something like:
float f = 0.75F;
or the compiler will be barf, since it only treats "0.75" as double. Is there anything that I can put into my code or install in Visual Studio that will make it treat the literal as “0.75” as floating without having to add “F” every time?
Float comes with F :-)
No - fortunately, IMO. Literals are treated the same everywhere.
- , . "0.75" " , # - !" , float? " .
"F" ? ? , "F-suffixed" .
. - .
, , , , .
, # 3, :
var f = 0.75F;
, F , .
FYI - # http://msdn.microsoft.com/en-us/library/6ds95cz0.aspx. , , - , - , @Jon Skeet.
var meaning = 1f;
"var" .
- , , double float , double float, ( ) , , , . float double ( , "" , ), , , ''.
double
float
, Microsoft double float? , , double, .
Source: https://habr.com/ru/post/1713058/More articles:Is there any good documentation on NHibernate request with an example? - nhibernateASP Option Explicit - problem with PayPal Express Checkout - vbscriptЭксклюзивная блокировка PostgreSQL прекращает применение - postgresqlHow to do If statement in Linq Query - linqList of built-in functions and methods (Python) - pythonFogbugz API - formatting data sent to sEvent field - xmlInitiate onclick faster than with document.onload - javascriptTab order in nested dialog tab control (WS_EX_CONTROLPARENT) - visual-c ++Problem with java.util.logging and Lock file - javaHow to add a date to a C # snippet - dateAll Articles