Click here to Skip to main content
15,887,135 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: zero int? Pin
KP Lee3-Dec-11 3:02
KP Lee3-Dec-11 3:02 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 3:27
harold aptroot3-Dec-11 3:27 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 10:21
KP Lee3-Dec-11 10:21 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 10:42
harold aptroot3-Dec-11 10:42 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 11:06
KP Lee3-Dec-11 11:06 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 11:19
harold aptroot3-Dec-11 11:19 
GeneralRe: zero int? Pin
Chris Berger22-Nov-11 8:46
Chris Berger22-Nov-11 8:46 
GeneralRe: zero int? Pin
greldak23-Nov-11 2:59
greldak23-Nov-11 2:59 
VB
Ironically, assingning zero to a variable of a numeric type is the most unproblematic case of all, since it turns out to be one or more zero bytes, no matter if we are looking at an integer type, a floating point type, signed or unsigned. The compiler knows the size (in bytes) of the variable the value is assigned to and there are no special ways to represent the number 'zero'. Therefore no special type information is needed in the assignment.



assuming you aren't needing to deal with the IEEE arithmetic concepts of +0 and -0
GeneralRe: zero int? Pin
CDP180223-Nov-11 3:03
CDP180223-Nov-11 3:03 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 0:40
KP Lee3-Dec-11 0:40 
GeneralRe: zero int? Pin
harold aptroot23-Nov-11 4:12
harold aptroot23-Nov-11 4:12 
GeneralRe: zero int? Pin
jsc4223-Nov-11 7:44
professionaljsc4223-Nov-11 7:44 
JokeRe: zero int? Pin
harold aptroot23-Nov-11 8:01
harold aptroot23-Nov-11 8:01 
JokeRe: zero int? Pin
Stefan_Lang12-Dec-11 6:18
Stefan_Lang12-Dec-11 6:18 
GeneralRe: zero int? Pin
BobJanova23-Nov-11 5:14
BobJanova23-Nov-11 5:14 
GeneralRe: zero int? Pin
CDP180223-Nov-11 5:17
CDP180223-Nov-11 5:17 
GeneralRe: zero int? Pin
AspDotNetDev23-Nov-11 6:45
protectorAspDotNetDev23-Nov-11 6:45 
GeneralRe: zero int? Pin
harold aptroot23-Nov-11 7:24
harold aptroot23-Nov-11 7:24 
GeneralRe: zero int? Pin
AspDotNetDev23-Nov-11 11:08
protectorAspDotNetDev23-Nov-11 11:08 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 1:51
KP Lee3-Dec-11 1:51 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 2:14
harold aptroot3-Dec-11 2:14 
AnswerRe: zero int? Pin
Nagy Vilmos21-Nov-11 23:52
professionalNagy Vilmos21-Nov-11 23:52 
GeneralRe: zero int? Pin
CDP180221-Nov-11 23:57
CDP180221-Nov-11 23:57 
GeneralRe: zero int? Pin
Nagy Vilmos21-Nov-11 23:58
professionalNagy Vilmos21-Nov-11 23:58 
GeneralRe: zero int? Pin
CDP180222-Nov-11 0:08
CDP180222-Nov-11 0:08 

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.