clojure中rem和mod的区别 详见clojure doc
2014-07-09 15:09
1061 查看
看例子
01 | user=> ( mod 10 5 ) |
02 | 0 |
03 |
04 | user=> ( mod 10 6 ) |
05 | 4 |
06 |
07 | user=> ( mod 10 10 ) |
08 | 0 |
09 |
10 | user=> ( mod 10 -1 ) |
11 | 0 |
12 |
13 | ;; The mod function is defined as the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number. |
14 | ;; The largest integer multiple of 5 not greater than -2 is 5 * -1 = -5. The amount by which -2 exceeds -5 is 3. |
15 | ;; |
16 | user=> ( mod -2 5 ) |
17 | 3 |
01 | ;;rem和mod通常用于求余数 |
02 | ;;mod的结果不为负数 此处文档有误 当(mod 10 -3)时输出为 -2 |
07 | user=> ( mod -10 3 ) |
08 | 2 |
09 | ;; -10 mod 3 (-12 mod 3 ) |
10ss | user=> ( rem -10 3 ) |
11 | -1 |
相关文章推荐
- 【转】取模(mod)与取余(rem)的区别——Matlab学习笔记
- Matlab中取模(mod)与取余(rem)的区别
- 取模(mod)与取余(rem)的区别
- matlab 取模(mod)与取余(rem)的区别
- matlab rem与mod 的区别
- 取模(mod)与取余(rem)的区别
- 取模(mod)与取余(rem)的区别
- vhdl中mod与rem的区别
- rem和mod的区别
- 【转】取模(mod)与取余(rem)的区别——Matlab学习笔记
- matlab中取模(mod)与取余(rem)的区别
- 【转】取模(mod)与取余(rem)的区别——Matlab学习笔记
- 取模(mod)与取余(rem)的区别
- matlab中rem与mod的区别
- MATLAB mod和rem的用法区别
- 取模(mod)与取余(rem)的区别——Matlab学习笔记
- SYS-BIOS中malloc和Memory_alloc的区别.doc
- %与mod的区别
- JServ/Tomcat/OC4J 有何区别 mod_jserv 和 mod_jk 的演变
- 取模MOD和求余REM……JAVA的%原来只是REM