Click here to Skip to main content
15,921,279 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: 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 
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 Pin
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 
I don't think so; MSDN says "The value of this constant is 4.94065645841247e-324.", as it is the smallest non-zero value a double can hold.

However what the OP probably needed is the smallest value you can add to one to make it different from one (that is about 1.E-15), or even a multiple thereof, as testing against the smallest possible value would be risky itself, as a lot of floating-point operations aren't accurate up to the last bit.

IMO they should not have called their value Epsilon.

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: 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 
GeneralRe: When is a double a string Pin
Electron Shepherd13-May-10 7:41
Electron Shepherd13-May-10 7:41 
GeneralRe: When is a double a string Pin
supercat914-May-10 6:36
supercat914-May-10 6:36 
GeneralRe: When is a double a string Pin
PIEBALDconsult13-May-10 4:39
mvePIEBALDconsult13-May-10 4:39 

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.