- 积分
- 92
- 注册时间
- 2003-5-19
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2006-3-17 12:04:15
|
显示全部楼层
来自 美国
Re:VF中用数学函数,需要包含那些库
没有Sgn这个函数,要用SIGN函数
SIGN
Elemental Intrinsic Function (Generic): Returns the absolute value of the first argument times the sign of the second argument.
Syntax
result = SIGN (a, b)
a
(Input) Must be of type integer or real.
b
Must have the same type and kind parameters as a.
c = SIGN (5.2, -3.1) ! returns -5.2
c = SIGN (-5.2, -3.1) ! returns -5.2
c = SIGN (-5.2, 3.1) ! returns 5.2
因此你的求符号的应该是:
SIGN(1, -5) 得到 -1 |
|