/ 运算符补充说明

练习题补充知识

  • a % b当a是小数时,公式 = a - (int) a/b*b

-10.5 % 3 = -10.5 - (int)(-10.5) / 3 * 3 = -10.5 + 10 / 3 * 3 = -10.5 + 3 * 3 = -1.5


本文章使用limfx的vscode插件快速发布