以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [讨论]关于整数运算的疑惑 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=13743) |
-- 作者:涛声依旧5666 -- 发布时间:2011/10/25 17:53:00 -- [讨论]关于整数运算的疑惑 Dim a As Integer = 5/2 Output.Show(a) 答案是: 2
Dim a As Integer = 5/2 + 1 Output.Show(a) 答案是: 4
Dim a As Integer = 5/2 + 5/2 Output.Show(a) 答案是: 5
........ 以上是否是FoxTable的BUG???? 请教了!!!!
类似: Dim a As Integer = 2.5 Output.Show(a) 答案是: 2
Dim a As Integer = 2.5 + 1 Output.Show(a) 答案是: 4
Dim a As Integer = 2.5 + 2.5 Output.Show(a) 答案是: 5 |
-- 作者:czy -- 发布时间:2011/10/25 18:27:00 -- 关键是你想要什么答案?
这样?
Dim a As Integer = 5\\2 + 1 |
-- 作者:涛声依旧5666 -- 发布时间:2011/10/25 18:36:00 -- 我个人认为: Dim a As Integer = 2.5 Output.Show(a) 答案是: 2 正确的答案: 2
Dim a As Integer = 2.5 + 1 Output.Show(a) 答案是: 4 正确的答案: 3
Dim a As Integer = 2.5 + 2.5 Output.Show(a) 答案是: 5 正确的答案: 5 不知高手们是否认同? |
-- 作者:blackzhu -- 发布时间:2011/10/26 7:30:00 -- 你要四舍五入,要给函数的. |