Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Fun Fact (http://www.chiefdelphi.com/forums/showthread.php?t=114299)

rai337 24-02-2013 09:34

Fun Fact
 
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

Re: Fun Fact
 
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

Re: Fun Fact
 
we used acos(1.04).. same affect basically..

dodar 24-02-2013 10:47

Re: Fun Fact
 
Quote:

Originally Posted by Kevin Sevcik (Post 1239586)
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

Re: Fun Fact
 
Quote:

Originally Posted by dodar (Post 1239597)
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

Re: Fun Fact
 
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

Re: Fun Fact
 
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

Re: Fun Fact
 
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

Re: Fun Fact
 
Quote:

Originally Posted by Greg McKaskle (Post 1239684)
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

Corollary: 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

Re: Fun Fact
 
Quote:

Originally Posted by Kevin Sevcik (Post 1239586)
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

Re: Fun Fact
 
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

Re: Fun Fact
 
Quote:

Originally Posted by Greg McKaskle (Post 1239684)
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.


All times are GMT -5. The time now is 22:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi