Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.25 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. casting result to float in method returning float changes result
  2. float a(float x, float y)
  3. {
  4.   return ( x * y );
  5. }
  6.  
  7. float b(float x, float y)
  8. {
  9.   return (float)( x * y );
  10. }
  11.  
  12. void Main()
  13. {
  14.   Console.WriteLine( a( 10f, 1f/10f ) == b( 10f, 1f/10f ) );
  15. }