NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

raise a number to a power in teststand

Anybody find a way to raise a number to a power in teststand?
0 Kudos
Message 1 of 3
(4,226 Views)
As of TestStand 3.0, you can use the following expression function:

Pow(base, exponent)
This function returns a base value raised to a specified power.
Parameter 1: A number specifying the base value.
Parameter 2: A number specifying the exponent value.
Returns: The number x raised to the power of y.

In 2.0.1 or earlier, your best bet would be to call a code module to do it.

- James
0 Kudos
Message 2 of 3
(4,226 Views)
Thanks. I also discovered if you're looking to raise 2 to a power (i.e. a binary value), you can use the expression "1 << y" where y is the exponent, to left shift a bit some number of bits. Specifically that's what I was trying to do, and this solution worked very well.
0 Kudos
Message 3 of 3
(4,226 Views)