Over a million developers have joined DZone.

Workaround for a Windows Phone Emulator Code Conversion Bug

DZone 's Guide to

Workaround for a Windows Phone Emulator Code Conversion Bug

· Mobile Zone ·
Free Resource
The author of the Mister Goodcat blog believes he has found a bug in the Windows Phone emulator that is causing incorrect conversions of some of his old C++ code into C#:

If you use this code for example in a .NET 4 console application, the output is as expected:

Double: 1,51608955473738E+19
UInt64: 15160895547373793280

Now use the same code, but run it in a Windows Phone 7 application, for example in a button click event handler. The output is:

Double: 1.51608955473738E+19
UInt64: 9223372036854775808
Uhm… what?  -- Mister Goodcat

Luckily, he says this bug only occurs in the emulator and works fine when you go straight to the actual phone.  He also gives us a workaround in the blog post.  If you want to comment on the bug he believes he found in the Windows Phone emulator, he encourages people to contact him and take a look at his bug report here:

Windows Phone Emulator cast double/UInt64 bug

Source: http://www.pitorque.de/MisterGoodcat/post/Windows-Phone-7-The-kind-of-bug-you-dont-want-to-discover.aspx

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}