简体   繁体   中英

Using NSIS Math Library: How to perform 'Power to'

I am attempting to use the NSIS Math Library to perform a Power calculation. I'm having alot of difficulty working out the Math library syntax.

How can I perform this calculation in NSIS: h ^= g;

Var h # example variables
Var g
Var a

# I am attempting to perform the following calculations in NSIS.
# I'm not sure how exactly to do it using the math library syntax?
# Do I need to include the Math.nsh library to use it?
# h ^= g;

# My attempt:
Math::Script "a = $h; b = $g; c = ?? a = Power(a,b,c); R0 = a"

It's quite similar to C/C++, to define a function that calculates XOR and returns the result, try;

Math::Script 'myxor(h,g) (h^g);'

After that myxor(3,2) will give you 3 XOR 2 = 1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM