Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class ComparingFloats
- {
- static void Main()
- {
- Console.WriteLine("input two floating point numbers:");
- double firstOne = double.Parse(Console.ReadLine());
- double secondOne = double.Parse(Console.ReadLine());
- bool equalsNumbers = Math.Abs(firstOne - secondOne) < 0.000001;
- Console.WriteLine(equalsNumbers);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment