LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

U32 ? I32

Solved!
Go to solution

Hello,

 

Why "LV" uses "I32" instead of "U32" ... whereas the result is never negative?

for example:
- the output "offset past number" of the function "Decimal String To Number"
- the loop iteration terminal of a While Loop or a For Loop ...
- the output "size" of the array size function

What is the meaning of a 32bit signed integer for a result which will never be negative?


Why did the labview developers make this choice?

0 Kudos
Message 1 of 5
(7,685 Views)

It take universal result into consideration. You can take positive value only in U32 but in I32 both values can be stored

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Message 2 of 5
(7,675 Views)

"with a I32 both values can be stored" ... indeed, good point!


but I think this "universal choice" causes a lot of unnecessary coercion dots!


What do you think about it?

0 Kudos
Message 3 of 5
(7,661 Views)
Solution
Accepted by topic author ouadji

I guess it is to make it consistent and thus to have less coercion dots. E.g. the output of search 1D array must be I32 since it returns a negative value if there's no match. If you wire a -1 to an index array you get the default value of the array data type.

The same is true for many other places where negative (-1) has a similar meaning. So there would be lots of coercion dots if LabVIEW would use U32 where a value can be only positive (like array size) but I32 where it can be both positive and negative.

 

Message 4 of 5
(7,652 Views)

Universal choice i.e. for both negative and positve value. Some function generates + result and some - result. Hence we need some indicator which take both the values. So I32 is best

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 5
(7,635 Views)