Click here to Skip to main content
15,903,175 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: Logical genius! Pin
cgh197714-Jul-10 6:45
cgh197714-Jul-10 6:45 
GeneralWrong on so many levels PinPopular
ARopo18-May-10 5:33
ARopo18-May-10 5:33 
GeneralRe: Wrong on so many levels PinPopular
Chris Boden18-May-10 6:41
Chris Boden18-May-10 6:41 
GeneralRe: Wrong on so many levels Pin
PIEBALDconsult18-May-10 6:56
mvePIEBALDconsult18-May-10 6:56 
GeneralRe: Wrong on so many levels Pin
ARopo18-May-10 21:47
ARopo18-May-10 21:47 
GeneralRe: Wrong on so many levels Pin
David Skelly18-May-10 22:42
David Skelly18-May-10 22:42 
GeneralRe: Wrong on so many levels Pin
ARopo18-May-10 23:47
ARopo18-May-10 23:47 
GeneralRe: Wrong on so many levels Pin
Luc Pattyn19-May-10 2:24
sitebuilderLuc Pattyn19-May-10 2:24 
No, most often it does not. There shouldn't be much discussion about the sign of a number. If you want to know whether it is negative, just use x < 0. That is quite different from the question "have we reached our target yet?", which does require some slack ("epsilon") to cope with rounding errors and other minor inaccuracies.

There is one exception: the result of some operation could be an extremely small number (say -1.E-500), which is mathematically negative, but can not be represented in a 64-bit floating-point number, and then gets stored as zero (or maybe "NotANumber").

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: Wrong on so many levels Pin
elchupathingy19-May-10 9:53
elchupathingy19-May-10 9:53 
GeneralWhen is a double a string Pin
Not Active13-May-10 4:02
mentorNot Active13-May-10 4:02 
AnswerRe: When is a double a string PinPopular
Chris Meech13-May-10 4:24
Chris Meech13-May-10 4:24 
GeneralRe: When is a double a string [modified] Pin
Luc Pattyn13-May-10 4:27
sitebuilderLuc Pattyn13-May-10 4:27 
GeneralRe: When is a double a string Pin
Not Active13-May-10 4:38
mentorNot Active13-May-10 4:38 
GeneralRe: When is a double a string Pin
PIEBALDconsult13-May-10 4:44
mvePIEBALDconsult13-May-10 4:44 
GeneralRe: When is a double a string Pin
Luc Pattyn13-May-10 4:44
sitebuilderLuc Pattyn13-May-10 4:44 
GeneralRe: When is a double a string Pin
Chris Losinger17-May-10 16:32
professionalChris Losinger17-May-10 16:32 
GeneralRe: When is a double a string Pin
Luc Pattyn17-May-10 16:44
sitebuilderLuc Pattyn17-May-10 16:44 
GeneralRe: When is a double a string Pin
Chris Losinger18-May-10 1:01
professionalChris Losinger18-May-10 1:01 
GeneralRe: When is a double a string Pin
supercat918-May-10 6:14
supercat918-May-10 6:14 
GeneralRe: When is a double a string Pin
David Skelly13-May-10 4:47
David Skelly13-May-10 4:47 
GeneralRe: When is a double a string Pin
Luc Pattyn13-May-10 4:50
sitebuilderLuc Pattyn13-May-10 4:50 
GeneralRe: When is a double a string Pin
J4amieC13-May-10 5:29
J4amieC13-May-10 5:29 
GeneralRe: When is a double a string Pin
Luc Pattyn13-May-10 5:33
sitebuilderLuc Pattyn13-May-10 5:33 
GeneralRe: When is a double a string Pin
Electron Shepherd13-May-10 6:59
Electron Shepherd13-May-10 6:59 
GeneralRe: When is a double a string Pin
Luc Pattyn13-May-10 7:35
sitebuilderLuc Pattyn13-May-10 7:35 

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.