Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _15_Comparing_floats
- {
- class ComparingFloats
- {
- static void Main(string[] args)
- {
- double eps = 0.000001;
- double diff = 0.0;
- double a = double.Parse(Console.ReadLine());
- double b = double.Parse(Console.ReadLine());
- diff = a - b;
- if (Math.Abs(diff) < eps)
- {
- Console.WriteLine("True");
- }
- else
- {
- Console.WriteLine("False");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement