VB:Sgn pricate sub command1_click()x= -5If sgn(x) then y=sgn(x^2)else y =sgn(x)end if print yend sub这两题 第一道sgn(-5^2)=1 第二题sgn(-6^2)=-1这是为啥我知道 正数就是1 负数就是-1 请看清楚我的问题我是想知道-5^2

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 14:06:01
VB:Sgn pricate sub command1_click()x= -5If sgn(x) then y=sgn(x^2)else y =sgn(x)end if print yend sub这两题 第一道sgn(-5^2)=1 第二题sgn(-6^2)=-1这是为啥我知道 正数就是1 负数就是-1 请看清楚我的问题我是想知道-5^2

VB:Sgn pricate sub command1_click()x= -5If sgn(x) then y=sgn(x^2)else y =sgn(x)end if print yend sub这两题 第一道sgn(-5^2)=1 第二题sgn(-6^2)=-1这是为啥我知道 正数就是1 负数就是-1 请看清楚我的问题我是想知道-5^2
VB:Sgn
pricate sub command1_click()
x= -5
If sgn(x) then y=sgn(x^2)
else y =sgn(x)
end if
print y
end sub
这两题 第一道sgn(-5^2)=1 第二题sgn(-6^2)=-1
这是为啥
我知道 正数就是1 负数就是-1 请看清楚我的问题
我是想知道-5^2是 -(5^2) 的意思还是 (-5)^2 还有上面那两道题都是历年的考题 到底是哪道有问题
========
第一个是1没错.那第二个也应该是1啊 怎么是-1,这答案不太可能错了呀.哭死

VB:Sgn pricate sub command1_click()x= -5If sgn(x) then y=sgn(x^2)else y =sgn(x)end if print yend sub这两题 第一道sgn(-5^2)=1 第二题sgn(-6^2)=-1这是为啥我知道 正数就是1 负数就是-1 请看清楚我的问题我是想知道-5^2
sgn()里面是正数就是1 负数就是-1
-5^2=-(5^2)
上面两个都是-1 你可以去VB试一下
你把这个式子输到VB就知道了 都是-1