BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

I found this in a third party driver.

 

In the error case, it looks like the programmer wanted to output a Not a Number value.  Okay, that makes sense.

 

But instead of using an NaN value in a constant, why don't we just take the square root of -1?

 

 

Message 881 of 2,635
(13,501 Views)

OOoooooooooooooohhhh

 

That's just getting nasty ...  or quite imaginative...  Don't know which one to attribute that one to..

0 Kudos
Message 882 of 2,635
(13,496 Views)

The fact that you can type NaN into the numeric constant is not obvious.


___________________
Try to take over the world!
Message 883 of 2,635
(13,473 Views)

 


@tst wrote:

The fact that you can type NaN into the numeric constant is not obvious.


 

True. Many years ago I suggested to add a NaN constant to the numeric palette, e.g. next to the +Inf, -Inf constants. (That was way before the ideas exachange)

 

Maybe it's time to write a new idea... stay tuned. 😄

0 Kudos
Message 884 of 2,635
(13,456 Views)

 


@Ravens Fan wrote:

I found this in a third party driver.

 

In the error case, it looks like the programmer wanted to output a Not a Number value.  Okay, that makes sense.

 

But instead of using an NaN value in a constant, why don't we just take the square root of -1?

 

 


Smiley Sad

 

 

Spoiler

 

I've done that

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 885 of 2,635
(13,392 Views)

 


@Jeff Bohrer wrote:

 


@Ravens Fan wrote:

I found this in a third party driver.

 

In the error case, it looks like the programmer wanted to output a Not a Number value.  Okay, that makes sense.

 

But instead of using an NaN value in a constant, why don't we just take the square root of -1?

 

 


Smiley Sad

 

 

Spoiler

 

I've done that

 


Maybe you did do that. Smiley Very Happy

 

Tim
GHSP
0 Kudos
Message 886 of 2,635
(13,355 Views)

I'd NEVER leave a terminal as icon- Smiley Very HappySmiley Very Happy


"Should be" isn't "Is" -Jay
Message 887 of 2,635
(13,338 Views)
0 Kudos
Message 888 of 2,635
(13,288 Views)

Another RG that can be simplified using our friendly Regular Expressions:

http://forums.ni.com/t5/LabVIEW/search-and-split-the-string/m-p/1548356

 

 

0 Kudos
Message 889 of 2,635
(13,276 Views)

Oftentimes when using Search and Replace, a while loop is used when you can simply Replace All.

 

RG SearchReplace.png

 

spotted here

Message 890 of 2,635
(13,258 Views)