那里的编码员 - 我怀疑全世界不超过10人:) - ,
我有一个非常非常简单的问题:
如何使用REAL计算sin,cos,tan或sqrt?
a: REAL
b: REAL
...
b := a.power(2)
有效,但......
a: REAL
b: REAL
...
b := a.sin(2)
b := a.tan(2)
b := a.cos(2)
b := a.sqrt()
......没有。
亲爱的互联网,请不要让我失望!
保罗:)
答案 0 :(得分:2)
有两个图书馆类:SINGLE_MATH
为REAL_32
,DOUBLE_MATH
为REAL_64
。如果您打算只使用一种实数,只需继承其中一个类并使用
b := sine (a)
b := cosine (a)
b := tangent (a)
b := sqrt (a)
如果你想混合单精度和双精度实数,你可以添加一次像
这样的函数single_math: SINGLE_MATH
once
create Result
end
然后使用
b := single_math.sine (a)
b := single_math.cosine (a)
b := single_math.tangent (a)
b := single_math.sqrt (a)