Created
April 2, 2016 15:57
-
-
Save ahrvoje/d25c8600d73cb149e978a0989198426c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // .NET v4.6.1073.0 for x64 target on Windows 10 | |
| using System; | |
| namespace NET_double_parse | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("{0:G1}", System.Double.Parse("2.4703282292062325e-324")); // 0 - correct | |
| Console.WriteLine("{0:G1}", System.Double.Parse("2.4703282292062326e-324")); // 5E-324 - should be 0 !!! | |
| Console.WriteLine("{0:G1}", System.Double.Parse("2.4703282292062327e-324")); // 5E-324 - should be 0 !!! | |
| Console.WriteLine("{0:G1}", System.Double.Parse("2.4703282292062328e-324")); // 5E-324 - correct | |
| Console.ReadKey(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment