但是,如果对浮点数使用取模和求余数操作符,则会产生错误,因为这些操作符只支持整数。
However, an error will be raised when using an equivalent of the modulus and remainder operators on floating values, as these support only integer values.
另外一个方法就是使用求模运算符了,百分号%就是了,求模运算就是求余数,会把两个数相除然后返回余数。
An alternative is to use the modulus operator, %, which divides two Numbers and returns the remainder.
另一件有意思的事情是拿着“d”的人可以对一个文档进行签名,其做法是文档“M”求“d”次幂然后应用模数“n”求余数“S”。
Just as interesting is that the person with "d" can "sign" a document by raising a message "m" to the "d" exponent.
应用推荐