System.out.println(21%-5);//1
    System.out.println(21%5);//1
    System.out.println(-21%-5);//-1
    System.out.println(-21%5);//-1

1、java中取模结果符号依赖左操作数的符号

2、右操作数的符号被忽略

相关文章:

  • 2021-12-15
  • 2021-06-28
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-11-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案