10-09-2009 12:25 PM - edited 10-09-2009 12:26 PM
memoryleak wrote:I don't see an arithmetic shift function in Labview, but you could build one by converting the number to an array of booleans and shifting to your heart's content.
Well, the "Scale by power of 2" function does an arithmetic shift for signed integers and a bitwise shift for unsigned integers.
What more do you want? 😄
(Shifting instead of dividing is usually done for performance reason, thus going through a boolean array seems quite silly. ;))
10-09-2009 12:34 PM - edited 10-09-2009 12:35 PM
Bah! I forgot that -1*2^(-1) would round back to -1 for integers 😞
I guess I'm banished back to arithmetic now 😉
04-22-2015 11:05 AM
Scale by power of two is the name of LabVIEW's arithmetic shift. I supposed an arithmetic shift function could be added to the data manipulation palette for clarity but it would do the exact same thing as the Scale by power of two.