Log in

View Full Version : Fun Fact


rai337
24-02-2013, 09:34
Did you know? When you compare 0 with NaN (Not a Number) in labview, the result is a broken shooter.
please don't try it at home (i'm assuming that your home is the lab.)

Kevin Sevcik
24-02-2013, 10:22
Just as long as you're not dividing by zero. Then your robot collapses into a pocket universe to preserve reality.

rai337
24-02-2013, 10:24
we used acos(1.04).. same affect basically..

dodar
24-02-2013, 10:47
Just as long as you're not dividing by zero. Then your robot collapses into a pocket universe to preserve reality.

So, 229 uses a special version of labview? :D

Mark McLeod
24-02-2013, 11:05
So, 229 uses a special version of labview? :D
Of course not, they're in a universe all their own.

SenorZ
24-02-2013, 12:07
This is most likely the result of the oxygen in your robot bag running out... this is why student programmers should not be bagged with the robot. :p

Greg McKaskle
24-02-2013, 14:30
Equally fun fact:
When you compare anything and one of the elements is NaN, the result is false. Nan > 0 is false and Nan < 0 is false and Nan == 0 is false.

And it isn't just LV. This is what IEEE 754 says to do. And it makes sense, but at the same time will surprise you at times when you least expect it -- possibly causing shooters to misbehave, wormholes to form, etc.

Greg McKaskle

Alan Anderson
24-02-2013, 15:35
If you do decide to experiment with exploiting wormholes, remember that game pieces from past or future games should not be allowed to enter the playing field. There's no rule against it yet, but R01 is always in force.

Kevin Sevcik
24-02-2013, 15:49
Equally fun fact:
When you compare anything and one of the elements is NaN, the result is false. Nan > 0 is false and Nan < 0 is false and Nan == 0 is false.

And it isn't just LV. This is what IEEE 754 says to do. And it makes sense, but at the same time will surprise you at times when you least expect it -- possibly causing shooters to misbehave, wormholes to form, etc.

Greg McKaskleCorollary: The smart programmer uses this fact to some advantage. If there's a possibility of you getting a NaN as result, then make sure your false case is what you'd want to run if you're processing a NaN. Makes things a lot more reliable.

toastnbacon
24-02-2013, 15:53
Just as long as you're not dividing by zero. Then your robot collapses into a pocket universe to preserve reality.

That's a mistake you only have to make twice...

JCharlton
24-02-2013, 23:33
In LabVIEW there's a block to check if isNaN. If I'd known then what I know now.

sur
25-02-2013, 22:14
Equally fun fact:
When you compare anything and one of the elements is NaN, the result is false. Nan > 0 is false and Nan < 0 is false and Nan == 0 is false.

And it isn't just LV. This is what IEEE 754 says to do. And it makes sense, but at the same time will surprise you at times when you least expect it -- possibly causing shooters to misbehave, wormholes to form, etc.

Apparently this is how IsNaN is implemented in C#: http://stackoverflow.com/a/1145462.