Skip to content

Instantly share code, notes, and snippets.

@mgravell
Created February 7, 2017 09:50
Show Gist options
  • Save mgravell/92d327bac5f3722b728922161c262f19 to your computer and use it in GitHub Desktop.
Save mgravell/92d327bac5f3722b728922161c262f19 to your computer and use it in GitHub Desktop.
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
class Program
{
static void Main()
{
var val = GetValue();
// DoubleConverter is from http://jonskeet.uk/csharp/DoubleConverter.cs
Console.WriteLine(DoubleConverter.ToExactString(val));
// 392.69999999999998863131622783839702606201171875
}
[MethodImpl(MethodImplOptions.NoInlining)]
static double GetValue()
{
return 392.7;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment