The modulus operator is more useful than it seems.
求模运算符的作用远不止如此。
SQL does not support the modulus operator on floating-point Numbers.
SQL不支持对浮点数字使用取模运算符。
An alternative is to use the format operator, %. When applied to integers, % is the modulus operator. But when the first operand is a string, % is the format operator.
另外一个方法就是用格式运算符,也就是百分号%。在用于整数的时候,百分号%是取余数的运算符。但当第一个运算对象是字符串的时候,百分号%就成了格式运算符了。
Exercise 4-3. Given the basic framework, it's straightforward to extend the calculator. Add the modulus (%) operator and provisions for negative Numbers.
练习4 - 3在有了基本框架后,对计算器程序进行扩充就比较简单了。在该程序中加入取模(%)运算符,并注意考虑负数的情况。
Any remainder can be obtained by using the modulus (%) operator.
所有的余数都可以使用取模运算得到。
Any remainder can be obtained by using the modulus (%) operator.
所有的余数都可以使用取模运算得到。
应用推荐