09-25-2013 03:13 AM
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?
Solved! Go to Solution.
09-25-2013 03:30 AM
It take universal result into consideration. You can take positive value only in U32 but in I32 both values can be stored
09-25-2013 03:57 AM
"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?
09-25-2013 04:31 AM - edited 09-25-2013 04:32 AM
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.
09-25-2013 06:19 AM - edited 09-25-2013 06:33 AM
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