Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FPTest
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. // These values don't _really_ matter. These were chosen
  10. // because they demonstrate a fairly large difference
  11. // in precision
  12. const Single a = 21.453241f;
  13. const Single b = 1654853;
  14. const Single c = 0.5f;
  15.  
  16. var scoreValue = Score(a, b, c);
  17. Console.WriteLine(scoreValue);
  18. Console.WriteLine((Double)scoreValue);
  19. Console.WriteLine((Double)Score(a, b, c));
  20. }
  21.  
  22. static Single Score(Single a, Single b, Single c)
  23. {
  24. return a + (b - a) * c;
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement