Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToString methods of ulong/UInt64 and long/Int64 are not returning the correct values #399

Closed
MatthiasJentsch opened this issue Sep 3, 2018 · 0 comments · Fixed by nanoframework/nf-interpreter#848

Comments

@MatthiasJentsch
Copy link
Contributor

Details about Problem

nanoFramework area: nanoCLR preview 791

Worked before? No

Detailed repro steps so we can see the same problem

using System;

namespace NFApp1
{
	public class Program
	{
		public static void Main()
		{
			// Should output "12345678998765432101" but outputs "2691296549"
			Console.WriteLine(((ulong)12345678998765432101).ToString());
			// Should output "AB54A9A3A069ED25" but outputs "00000000A069ED25"
			Console.WriteLine(((ulong)12345678998765432101).ToString("X16"));
			// Should output "-1234567899876543210" but outputs "1019360534"
			Console.WriteLine(((long)-1234567899876543210).ToString());
			// Should output "EEDDEF093CC23516" but outputs "3CC2351600000000"
			Console.WriteLine(((long)-1234567899876543210).ToString("X16"));
		}
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants