Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将整数除法 () 除以 0.25,但 VB 告诉我我尝试除以零,我也尝试除以 (1/4)。
这是我的片段
AmountLeft = Remainder \ 0.25 lblQuartersAmount.Text = AmountLeft
您不能用非整数进行整数除法;只是截断并在之后投射它。
AmountLeft = CInt(Math.Truncate(Remainder / 0.25))
有什么问题* 4?=)
* 4