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
Wenn nicht, ist ein Guss der einzige Weg, dies erreicht werden kann? Ich bin in erster Linie daran interessiert, während bestimmter Operationen mit doppelter Genauigkeit Mathe zu gewährleisten, etc:Gibt es numerische Suffixe für die Angabe eines Double?
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?
Weitere Tipps über die Gestattung der Compiler automatisch bestimmen, welche Arten während einer Operation nützlich wäre.
genau die Informationen, die ich brauche. Vielen Dank. – BuckFilledPlatypus