Click here to Skip to main content
15,893,487 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Matias Lopez16-Feb-22 4:05
Matias Lopez16-Feb-22 4:05 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Matthew Dennis16-Feb-22 4:21
sysadminMatthew Dennis16-Feb-22 4:21 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
OriginalGriff16-Feb-22 4:56
mveOriginalGriff16-Feb-22 4:56 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
DRHuff16-Feb-22 4:51
DRHuff16-Feb-22 4:51 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
k505416-Feb-22 5:12
mvek505416-Feb-22 5:12 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
kmoorevs16-Feb-22 8:05
kmoorevs16-Feb-22 8:05 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Gerry Schmitz16-Feb-22 8:22
mveGerry Schmitz16-Feb-22 8:22 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
trønderen16-Feb-22 9:18
trønderen16-Feb-22 9:18 
Comparing for equality two real valued calculated results, which should mathematically be identical, but due to limited precision, they differ in the least significant bit (or two).

If you were working on old machines using 1-complement integer representation, you could also compare plus and minus zero for equality, but I haven't seen a 1-complement machine for quite a few years now.

A related one: When casting (implied or explicitly) to a longer word length, will the upper bits be zero or sign bit filled? Note: This can be both language/datatype and machine architecture dependent. I once spent half a day to understand a single if(x>y) statement: Both alternative seemed to do exactly the same, just in slightly different order. The reason was an implied cast (from 8 to 16 bits - this was on an 8051) where "wrong" sign extension would wreck the result if the same order of execution was used in both cases.

Edit: This was intended as a reply to the OP, not as a reply to Gerry.
GeneralRe: Oh boy. I've given myself a challenge now. Pin
charles henington16-Feb-22 11:17
charles henington16-Feb-22 11:17 
JokeRe: Oh boy. I've given myself a challenge now. Pin
Memtha16-Feb-22 15:45
Memtha16-Feb-22 15:45 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Mycroft Holmes16-Feb-22 11:36
professionalMycroft Holmes16-Feb-22 11:36 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
FreedMalloc16-Feb-22 14:26
FreedMalloc16-Feb-22 14:26 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
englebart16-Feb-22 14:52
professionalenglebart16-Feb-22 14:52 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Memtha16-Feb-22 15:52
Memtha16-Feb-22 15:52 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
David O'Neil16-Feb-22 22:14
professionalDavid O'Neil16-Feb-22 22:14 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Memtha17-Feb-22 5:23
Memtha17-Feb-22 5:23 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
trønderen17-Feb-22 6:40
trønderen17-Feb-22 6:40 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Memtha17-Feb-22 6:53
Memtha17-Feb-22 6:53 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
David O'Neil16-Feb-22 22:22
professionalDavid O'Neil16-Feb-22 22:22 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Richard Deeming17-Feb-22 2:08
mveRichard Deeming17-Feb-22 2:08 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
FreedMalloc17-Feb-22 5:25
FreedMalloc17-Feb-22 5:25 
GeneralCCC 2022-02-16 Pin
Peter_in_278015-Feb-22 22:03
professionalPeter_in_278015-Feb-22 22:03 
GeneralRe: CCC 2022-02-16 Pin
OriginalGriff15-Feb-22 22:05
mveOriginalGriff15-Feb-22 22:05 
GeneralRe: CCC 2022-02-16 Pin
pkfox15-Feb-22 23:19
professionalpkfox15-Feb-22 23:19 
GeneralRe: CCC 2022-02-16 Pin
OriginalGriff15-Feb-22 23:25
mveOriginalGriff15-Feb-22 23:25 

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.