简体   繁体   English

使用NSIS数学库:如何执行“加电”

[英]Using NSIS Math Library: How to perform 'Power to'

I am attempting to use the NSIS Math Library to perform a Power calculation. 我试图使用NSIS数学函数库进行Power计算。 I'm having alot of difficulty working out the Math library syntax. 我在计算数学库语法方面有很多困难。

How can I perform this calculation in NSIS: h ^= g; 如何在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; 它非常类似于C / C ++,要定义一个计算XOR并返回结果的函数,请尝试;

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

After that myxor(3,2) will give you 3 XOR 2 = 1. 之后,myxor(3,2)将给您3 XOR 2 = 1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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