08-12-2009 01:21 PM
What is the correct syntax for an exponent with the expression node?
I looked in LabVIEW help, and it looked like it was the '^' character,
except that doesnt appear to be correct:
The correct output should be 2, but LabVIEW returns 3.
Solved! Go to Solution.
08-12-2009 01:25 PM
08-12-2009 01:25 PM - edited 08-12-2009 01:26 PM
Sorry to bother you guys, I answered my own question.
I forgot that in some text languages the syntax for an exponent is:
2 ** x.
That gave me the correct output.
Edit: Good, someone beat me to the punch so I can mark them as the solution
08-12-2009 01:32 PM
10-09-2009 06:43 AM
09-24-2012 03:50 AM - edited 09-24-2012 03:53 AM
@Darin.K wrote:
That is easily in my top 2 or 3 LV pet peeves. I use exponentiation countless times and the next time I use bit-wise XOR in a LV text formula will be my first. Why couldn't LV be like every other program/language I have used and use ^ for exponentiation?
Define your definition of every other programming language!
There are Ada, Bash, COBOL, Fortran, FoxPro, Gnuplot, OCaml, Perl, PL/I, Python, Rexx, Ruby, SAS, Seed7, Tcl, ABAP, Haskell (for floating-point exponents), Turing, VHDL which do just as LabVIEW, Algol, Commodore BASIC which use a special symbol ↑, and
some like Java who don't even have a special exponentiation operator, but require the call of a math library function.
BASIC, J, MATLAB, R, Microsoft Excel, TeX (and its derivatives), TI-BASIC, bc (for integer exponents), Haskell (for nonnegative integer exponents), Lua, ASP and most computer algebra systems do use indeed the ^ symbol, but in Bash, C, C++, C#, Java, JavaScript, Perl, PHP, Python and Ruby, the symbol ^ is used for the XOR operator and the LabVIEW formula node borrowed a lot of syntax from C and is in its current incarnation in fact a limited C syntax environment, so that leaves the ^symbol not available for the exponentiation anymore.
Also I would say that LabVIEW is indeed more a programming language and not a computer algebra system.