如何在水晶报告中找到数字的n次幂。
For E.g
For 2 to the power of 4 should return 16
2 to the power of 5 should return 32.
答案 0 :(得分:0)
不知何故设法解决了我的问题,虽然解决方案很奇怪。发布以便任何人都可以使用。
Local stringVar array x:= ['c1','c2'];
Local NumberVar i;
Local NumberVar j:=1;
For i:=0 to (Count(x)) do
(
if(i=0) then
(
j:=2;
)
else
j:=(j*2)+(j*2);
i:=i+1;
);
Count(x);
if(Count(x)=1) then
(
j:=2;
)
else
j/2;
答案 1 :(得分:0)
插入符号(^
)是您正在寻找的运算符。
示例:2 ^ 4
计算结果为16,2 ^ 5
计算结果为32