LAVA 1.0 Content Posted May 7, 2008 Report Posted May 7, 2008 I'm refactoring an application made a few years ago by someone who is no longer in my company and here is a funny bit of code I wanted to share : /pedantic Am I bigger than someone smaller than me AND smaller than someone bigger than me ? How good is that ! pedantic/ Ok.. lots of us - crazy coffee drinkers - happen to wire too fast sometimes, but still... it's better to laugh about that ! Quote
tnt Posted May 7, 2008 Report Posted May 7, 2008 QUOTE (Antoine @ May 6 2008, 11:48 AM) Am I bigger than someone smaller than me AND smaller than someone bigger than me ? In fact this is NOT always TRUE !!! Nan = FALSE, -Inf = FALSE, Inf = FALSE Happy wiring, TNT Quote
Sebastian Posted May 7, 2008 Report Posted May 7, 2008 Hi! I think it is a hysteresis!! Isn't it? /Sebastian Quote
LAVA 1.0 Content Posted May 7, 2008 Author Report Posted May 7, 2008 QUOTE (tnt @ May 6 2008, 11:16 AM) In fact this is NOT always TRUE !!! Right QUOTE I think it is a hysteresis!! Isn't it? No, in fact it's a bit of code that remained after a specification change. It was not the only one, but it was the funniest. Quote
crelf Posted May 7, 2008 Report Posted May 7, 2008 QUOTE (Antoine @ May 6 2008, 05:48 AM) I'm refactoring an application made a few years ago by someone who is no longer in my company and here is a funny bit of code I wanted to share: Love it! Quote
bmoyer Posted May 7, 2008 Report Posted May 7, 2008 QUOTE (Antoine @ May 6 2008, 05:48 AM) /pedanticAm I bigger than someone smaller than me AND smaller than someone bigger than me ? How good is that ! pedantic/ Or am I taller than myself when I where thick soled shoes and shorter when I take them off. Bruce Quote
shoneill Posted May 7, 2008 Report Posted May 7, 2008 QUOTE (bmoyer @ May 6 2008, 01:53 PM) Or am I taller than myself when I where thick soled shoes and shorter when I take them off.Bruce What happens if the precision available for the datatype doesn't allow the addition or subtraction of 0.2. Can't this happen when a DBL number is really large. 15 significant digits I believe. So if the number's large, won't the +_ 0.2 have basically no effect on the number? Could it be a somewhat crpytical "available precision" check? Shane PS Just thinking out loud, I didn't program it!!! Quote
Aristos Queue Posted May 7, 2008 Report Posted May 7, 2008 The check for NAN and the check for precision are interesting ideas. The precision test seems most reasonable because otherwise, why pick 0.2 as your split? It's a fairly arbitrary value. Quote
Yair Posted May 7, 2008 Report Posted May 7, 2008 QUOTE (Aristos Queue @ May 6 2008, 07:40 PM) why pick 0.2 as your split? It's magic! Quote
shoneill Posted May 7, 2008 Report Posted May 7, 2008 QUOTE (Aristos Queue @ May 6 2008, 05:40 PM) The check for NAN and the check for precision are interesting ideas. The precision test seems most reasonable because otherwise, why pick 0.2 as your split? It's a fairly arbitrary value. That's what I thought. I reckon the 0.2 has some significance (no pun intended). I've fallen into floating point traps often enough to have the ins and outs of floating point precision more or less burned into my brain. I think there are pages from the LabVIEW manual visible on my CAT Scans...... Hope I don't get sued for copyright Infringement..... Shane Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.