Click here to Skip to main content
15,117,318 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Undoubtedly this is my own ignorance in glorious action but... Pin
Andy Bantly6-Aug-13 11:54
MemberAndy Bantly6-Aug-13 11:54 
GeneralSo you think you know what double.Parse does? Pin
harold aptroot3-Aug-13 0:27
Memberharold aptroot3-Aug-13 0:27 
GeneralRe: So you think you know what double.Parse does? Pin
PIEBALDconsult3-Aug-13 6:31
professionalPIEBALDconsult3-Aug-13 6:31 
GeneralRe: So you think you know what double.Parse does? Pin
Dennis_E4-Aug-13 9:25
professionalDennis_E4-Aug-13 9:25 
GeneralRe: So you think you know what double.Parse does? Pin
harold aptroot4-Aug-13 10:07
Memberharold aptroot4-Aug-13 10:07 
GeneralRe: So you think you know what double.Parse does? Pin
Dennis_E7-Aug-13 8:38
professionalDennis_E7-Aug-13 8:38 
GeneralRe: So you think you know what double.Parse does? Pin
harold aptroot7-Aug-13 8:51
Memberharold aptroot7-Aug-13 8:51 
GeneralRe: So you think you know what double.Parse does? Pin
Rob Grainger15-Aug-13 1:18
MemberRob Grainger15-Aug-13 1:18 
Others may find it logical that zero cannot be positive.

Seriously though, floating-point numbers are defined by an international standard (IEEE 754) that allows for +0 and -0. They have well defined meanings. Wiki[^]

The problem here is that while the language respects these, double.Parse fails to.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: So you think you know what double.Parse does? Pin
AlphaDeltaTheta4-Aug-13 21:50
MemberAlphaDeltaTheta4-Aug-13 21:50 
GeneralRe: So you think you know what double.Parse does? Pin
Lutosław6-Aug-13 11:56
MemberLutosław6-Aug-13 11:56 
GeneralRe: So you think you know what double.Parse does? Pin
harold aptroot6-Aug-13 11:59
Memberharold aptroot6-Aug-13 11:59 
GeneralRe: So you think you know what double.Parse does? Pin
Lutosław6-Aug-13 12:15
MemberLutosław6-Aug-13 12:15 
GeneralRe: So you think you know what double.Parse does? Pin
ExcellentOrg21-Aug-13 1:07
MemberExcellentOrg21-Aug-13 1:07 
GeneralFace, meet palm... Pin
Dave Kreskowiak2-Aug-13 10:45
mveDave Kreskowiak2-Aug-13 10:45 
GeneralRe: Face, meet palm... Pin
lewax002-Aug-13 11:22
Memberlewax002-Aug-13 11:22 
GeneralBest Function Ever Pin
LNogueira2-Aug-13 7:20
MemberLNogueira2-Aug-13 7:20 
GeneralRe: Best Function Ever Pin
Sentenryu2-Aug-13 7:44
MemberSentenryu2-Aug-13 7:44 
GeneralRe: Best Function Ever PinPopular
Ravi Bhavnani2-Aug-13 8:08
professionalRavi Bhavnani2-Aug-13 8:08 
GeneralRe: Best Function Ever Pin
ZurdoDev2-Aug-13 9:03
professionalZurdoDev2-Aug-13 9:03 
GeneralRe: Best Function Ever Pin
Paul M Watt2-Aug-13 8:58
mentorPaul M Watt2-Aug-13 8:58 
GeneralRe: Best Function Ever Pin
Andy Bantly5-Aug-13 8:56
MemberAndy Bantly5-Aug-13 8:56 
GeneralRe: Best Function Ever Pin
Mohibur Rashid19-Aug-13 18:37
professionalMohibur Rashid19-Aug-13 18:37 
GeneralRe: Best Function Ever Pin
ZurdoDev2-Aug-13 9:05
professionalZurdoDev2-Aug-13 9:05 
GeneralRe: Best Function Ever Pin
Mladen Janković2-Aug-13 11:31
MemberMladen Janković2-Aug-13 11:31 
GeneralRe: Best Function Ever Pin
Paul M Watt5-Aug-13 19:11
mentorPaul M Watt5-Aug-13 19:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.