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

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

  • Comments 5

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!

Leave a Comment
  • Please add 4 and 8 and type the answer here:
  • Post
Page 1 of 1 (5 items)