Created
December 31, 2020 05:27
-
-
Save yanfeng42/f71cb96998575b53a30e5413a7b6d0dd to your computer and use it in GitHub Desktop.
可能很有用的工具方法: 计算任意底数的对数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define logB | |
(lambda (x B) | |
(/ (log x) (log B)))) | |
(define (log3 x) | |
(logB x 3) | |
) | |
; (log3 9) -> 2.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
不同语言, 一般不直接提供 计算任意底数的对数的方法.