LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why -0 as result of a null multiplication?

Solved!
Go to solution

Hello, everyone.
I have a problem that may seem very trivial, but it bothers me a lot.

Why is it that when I multiply a constant double of value 0 by a negative number I get the result -0? How can I prevent this from happening?

 

Chricolomba_0-1676537893103.pngChricolomba_1-1676537906151.png

 

Thanks to everyone who will help me out, have a nice day!

 

0 Kudos
Message 1 of 2
(641 Views)
Solution
Accepted by topic author Chricolomba

Because LabVIEW follows IEEE 754. 

 

Wikipedia has a short description how that works: https://en.wikipedia.org/wiki/Signed_zero

 

You can add 0 to -0 to get 0:

https://forums.ni.com/t5/LabVIEW/quot-minus-zero-quot-in-numeric-indicator/td-p/1831859

 

 

Certified LabVIEW Architect
Message 2 of 2
(629 Views)