13,352,175 members (74,133 online)

# 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.

 When things to more than you think imagiro6-Aug-13 8:17 imagiro 6-Aug-13 8:17
 Re: When things to more than you think Super Lloyd6-Aug-13 22:13 Super Lloyd 6-Aug-13 22:13
 Undoubtedly this is my own ignorance in glorious action but... Andy Bantly5-Aug-13 8:52 Andy Bantly 5-Aug-13 8:52
 Re: Undoubtedly this is my own ignorance in glorious action but... Matt U.5-Aug-13 9:10 Matt U. 5-Aug-13 9:10
 Re: Undoubtedly this is my own ignorance in glorious action but... Andy Bantly5-Aug-13 10:22 Andy Bantly 5-Aug-13 10:22
 Re: Undoubtedly this is my own ignorance in glorious action but... Matt U.5-Aug-13 11:02 Matt U. 5-Aug-13 11:02
 Re: Undoubtedly this is my own ignorance in glorious action but... Andy Bantly6-Aug-13 11:54 Andy Bantly 6-Aug-13 11:54
 So you think you know what double.Parse does? harold aptroot3-Aug-13 0:27 harold aptroot 3-Aug-13 0:27
 I thought I knew, but I was wrong. ```double x0 = 1 / 0.0; double x1 = 1 / -0.0; double x2 = 1 / double.Parse("0.0"); double x3 = 1 / double.Parse("-0.0");``` Obviously these are all going to be some sort of infinity (yes you can divide by zero[^], and the result is infinity). One might reasonably expect both `x1` and `x3` to be Negative Infinity .. however, only `x1` is Negative Infinity. `x3` is Positive Infinity, which is about as wrong as any answer could possibly be. This implies that double.Parse blatantly ignores the sign of zero.
 Re: So you think you know what double.Parse does? PIEBALDconsult3-Aug-13 6:31 PIEBALDconsult 3-Aug-13 6:31
 Re: So you think you know what double.Parse does? Grimlock4-Aug-13 9:25 Grimlock 4-Aug-13 9:25
 Re: So you think you know what double.Parse does? harold aptroot4-Aug-13 10:07 harold aptroot 4-Aug-13 10:07
 Re: So you think you know what double.Parse does? Grimlock7-Aug-13 8:38 Grimlock 7-Aug-13 8:38
 Re: So you think you know what double.Parse does? harold aptroot7-Aug-13 8:51 harold aptroot 7-Aug-13 8:51
 Re: So you think you know what double.Parse does? Rob Grainger15-Aug-13 1:18 Rob Grainger 15-Aug-13 1:18
 Re: So you think you know what double.Parse does? Amitosh S.M.4-Aug-13 21:50 Amitosh S.M. 4-Aug-13 21:50
 Re: So you think you know what double.Parse does? Jacek Gajek6-Aug-13 11:56 Jacek Gajek 6-Aug-13 11:56
 Re: So you think you know what double.Parse does? harold aptroot6-Aug-13 11:59 harold aptroot 6-Aug-13 11:59
 Re: So you think you know what double.Parse does? Jacek Gajek6-Aug-13 12:15 Jacek Gajek 6-Aug-13 12:15
 Re: So you think you know what double.Parse does? ExcellentOrg21-Aug-13 1:07 ExcellentOrg 21-Aug-13 1:07
 Face, meet palm... Dave Kreskowiak2-Aug-13 10:45 Dave Kreskowiak 2-Aug-13 10:45
 Re: Face, meet palm... lewax002-Aug-13 11:22 lewax00 2-Aug-13 11:22
 Best Function Ever LNogueira2-Aug-13 7:20 LNogueira 2-Aug-13 7:20
 Re: Best Function Ever Sentenryu2-Aug-13 7:44 Sentenryu 2-Aug-13 7:44
 Re: Best Function Ever Ravi Bhavnani2-Aug-13 8:08 Ravi Bhavnani 2-Aug-13 8:08
 Re: Best Function Ever ryanb312-Aug-13 9:03 ryanb31 2-Aug-13 9:03
 Last Visit: 31-Dec-99 19:00     Last Update: 20-Jan-18 12:07 Refresh « Prev1...151152153154155156157158159160 Next »