Are there any numeric suffixes for specifying a double?

Viewed 13294
void Foo(float  a){}  //1
void Foo(double a){}  //2 overloaded


Foo(1.0f);                           //calls function 1
Foo(1.0 /*double numeric suffix?*/); //calls function 2

If not, is a cast the only way this can be achieved? I am mainly interested in ensuring double precision math during certain operations, etc:

ulong j;
double v;

j = /*some value*/;
if(j>0UL)
  v = 1.0 / j;  //if 1.0 is set as a float by the compiler then
                //could it be likely we lose some precision here 
                //if a double would allow for more precision?  Is
                //a cast the only means of ensuring double precision?

Other tips on allowing the compiler to auto-determine the types during an operation would be helpful.

1 Answers
Related