Click here to Skip to main content
15,891,529 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: So you want binary exponentiation? Pin
Luc Pattyn5-Mar-10 5:23
sitebuilderLuc Pattyn5-Mar-10 5:23 
GeneralRe: So you want binary exponentiation? Pin
harold aptroot5-Mar-10 5:35
harold aptroot5-Mar-10 5:35 
GeneralRe: So you want binary exponentiation? Pin
Luc Pattyn5-Mar-10 5:38
sitebuilderLuc Pattyn5-Mar-10 5:38 
GeneralRe: So you want binary exponentiation? Pin
harold aptroot5-Mar-10 5:39
harold aptroot5-Mar-10 5:39 
GeneralRe: So you want binary exponentiation? [modified] Pin
Luc Pattyn5-Mar-10 5:55
sitebuilderLuc Pattyn5-Mar-10 5:55 
GeneralRe: So you want binary exponentiation? Pin
harold aptroot5-Mar-10 6:31
harold aptroot5-Mar-10 6:31 
GeneralRe: Ever heard of casting? Pin
Luc Pattyn3-Mar-10 6:04
sitebuilderLuc Pattyn3-Mar-10 6:04 
GeneralRe: Ever heard of casting? Pin
Rob Grainger16-Mar-10 3:05
Rob Grainger16-Mar-10 3:05 
Not sure a cast is the best approach here - decimal types are OK for currency and other situations where accuracy is critical.
Floating point types can introduce rounding errors - it all depends how the value is used.

Best solution I've seen in the comments is 1E18M, but really 1E19M may be better Wink | ;-)
GeneralRe: Ever heard of casting? Pin
Avi Berger16-Mar-10 4:38
Avi Berger16-Mar-10 4:38 
GeneralGet the length of the path (not the filename) Pin
Eric Haddan24-Feb-10 8:46
Eric Haddan24-Feb-10 8:46 
JokeRe: Get the length of the path (not the filename) Pin
PIEBALDconsult25-Feb-10 3:48
mvePIEBALDconsult25-Feb-10 3:48 
JokeRe: Get the length of the path (not the filename) Pin
Stanciu Vlad25-Feb-10 21:46
Stanciu Vlad25-Feb-10 21:46 
GeneralRe: Get the length of the path (not the filename) Pin
WiGgLr25-Feb-10 22:23
WiGgLr25-Feb-10 22:23 
GeneralRe: Get the length of the path (not the filename) Pin
PIEBALDconsult26-Feb-10 7:30
mvePIEBALDconsult26-Feb-10 7:30 
GeneralRe: Get the length of the path (not the filename) Pin
Michael J. Eber23-Mar-10 15:16
Michael J. Eber23-Mar-10 15:16 
GeneralPut your right paren in, take your right paren out... Pin
ColinBashBash16-Feb-10 9:27
ColinBashBash16-Feb-10 9:27 
GeneralRe: Put your right paren in, take your right paren out... Pin
ColinBashBash16-Feb-10 9:33
ColinBashBash16-Feb-10 9:33 
GeneralRe: Put your right paren in, take your right paren out... Pin
supercat917-Feb-10 12:01
supercat917-Feb-10 12:01 
GeneralRe: Put your right paren in, take your right paren out... Pin
sergiogarcianinja18-Feb-10 4:59
sergiogarcianinja18-Feb-10 4:59 
GeneralRe: Put your right paren in, take your right paren out... Pin
David Skelly18-Feb-10 5:44
David Skelly18-Feb-10 5:44 
GeneralRe: Put your right paren in, take your right paren out... Pin
Jason Vetter23-Feb-10 12:04
Jason Vetter23-Feb-10 12:04 
GeneralExstream Younit Testing Pin
leppie15-Feb-10 20:06
leppie15-Feb-10 20:06 
GeneralRe: Exstream Younit Testing Pin
Member 35753716-Feb-10 6:24
Member 35753716-Feb-10 6:24 
GeneralRe: Exstream Younit Testing Pin
leppie16-Feb-10 6:31
leppie16-Feb-10 6:31 
GeneralRe: Exstream Younit Testing Pin
Wes Jones16-Feb-10 18:29
Wes Jones16-Feb-10 18:29 

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.