且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检查 Float 是否等效于 Ruby 中的整数值

更新时间:2023-11-30 22:50:34

mod 将值设为 1,并检查值是否等于 0.

You mod the value with 1, and check if the value equals 0.

if y % 1 == 0