Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FloatPointPrecision
- {
- static void Main()
- {
- decimal a = 7.5402m;
- decimal b = 7.5401m;
- decimal c = 7.54000004m;
- decimal d = 7.54000009m;
- decimal x = a - b;
- decimal y = c - d;
- bool v = Math.Abs(x) < 0.000001m;
- bool z = Math.Abs(y) < 0.000001m;
- Console.WriteLine("{0}\n{1}",v,z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement