Udostępnij za pośrednictwem


Do you know your language? Solving the tiny C# quiz :-)

Impressive! Based on this feedback I should do more quizzes ;-) What do you think?

((floatobject)1.2F) is not *really* a float, but a float box. You're allowed to cast from float to double, but not from a boxed float to double. You can unbox to float and then convert that to a double via
double d = (double)((float)1.2F);

Details can be found at C# Programmer's Reference > Unboxing Conversion.

Cheers

   Daniel

20071008, 23:58: Typo corrected. Thx Roger!

Comments