Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

double.Parse bug


  • Please log in to reply
3 replies to this topic

#1 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 29 March 2011 - 10:02 PM

I think I may have stumbled across quite a surprising bug. It seems that double.Parse ignores the sign of numbers between 0 and -1.

double d = double.Parse("-0.1");
gives us d = 0.1

I assume this is probably a .NETMF bug rather than Netduino specific, but it seems odd that this would have slipped through the net.

#2 demonGeek

demonGeek

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationCanada

Posted 30 March 2011 - 12:15 AM

Confirmed. I see the same behaviour in NETMF but not in the full framework. -0.1 to -0.9 are parsed as positive values.

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 March 2011 - 06:44 PM

Hi Fred, I've verified that this is an issue which also exists in the .NET MF emulator, and have reported the bug to Microsoft. http://netmf.codeplex.com/workitem/788 Thank you for reporting this, Chris

#4 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 30 March 2011 - 09:15 PM

Thanks. It causes a real problem with GPS calculations when you live just a little bit west of the Greenwich Meridian!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.