Created
August 22, 2012 14:28
-
-
Save Immerseit/3426121 to your computer and use it in GitHub Desktop.
Unexpected (maybe?) result hided behind bad use of "float"
This file contains 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
void Main() | |
{ | |
string item = "134217963"; | |
ValueFlags vf = new ValueFlags(); | |
float _value; | |
if (float.TryParse(item, out _value)) | |
{ | |
vf.Value = _value.ToString(); | |
} | |
Console.WriteLine("{0}", item); | |
Console.WriteLine("{0}", vf.Value); | |
Console.WriteLine("{0}", double.Parse(vf.Value)); | |
} | |
public class ValueFlags | |
{ | |
public string Value { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment