Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace P16_ComparingFloats
- {
- class Program
- {
- static void Main(string[] args)
- {
- double num1 = double.Parse(Console.ReadLine());
- double num2 = double.Parse(Console.ReadLine());
- double diff = Math.Abs(num1 - num2);
- const double eps = 0.000001;
- bool areNumsRelativeEqual = diff < eps;
- Console.WriteLine(areNumsRelativeEqual);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment