From 2e2e3ad612ca35ed9103a7671443ab0511e18ae4 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 11:46:39 -0400 Subject: [PATCH 1/4] Add documentation for math.log() --- shared-bindings/math/__init__.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index d41097ad8e..f25c261ef5 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -157,6 +157,11 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| +//| def log(x: float, base: float = math.e) -> float: +//| """Return the logarithm of x to the given base. If base is not specified, +//| returns the natural logarithm (base e) of x"" +//| ... +//| //| def modf(x: float) -> Tuple[float, float]: //| """Return a tuple of two floats, being the fractional and integral parts of //| ``x``. Both return values have the same sign as ``x``.""" From af59f4938af194ef7739010282431d6a5da7970d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 19 Apr 2022 12:57:22 -0400 Subject: [PATCH 2/4] Missing double-quote --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index f25c261ef5..c6ecbad2b6 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -159,7 +159,7 @@ STATIC NORETURN void math_error(void) { //| //| def log(x: float, base: float = math.e) -> float: //| """Return the logarithm of x to the given base. If base is not specified, -//| returns the natural logarithm (base e) of x"" +//| returns the natural logarithm (base e) of x""" //| ... //| //| def modf(x: float) -> Tuple[float, float]: From 63c18ce748c7e1efaffe43a1fb38ca19981b457b Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 12:57:42 -0400 Subject: [PATCH 3/4] Change signature of math.log() to use value for base --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index f25c261ef5..f0698164a7 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -157,7 +157,7 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| -//| def log(x: float, base: float = math.e) -> float: +//| def log(x: float, base: float = 2.71828) -> float: //| """Return the logarithm of x to the given base. If base is not specified, //| returns the natural logarithm (base e) of x"" //| ... From 211d42f58d9f1585a7291ad0058b1cc346bc63ec Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 19 Apr 2022 13:27:46 -0400 Subject: [PATCH 4/4] Change value of base in math.log to e --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 2d76341b25..4146112d20 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -157,7 +157,7 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| -//| def log(x: float, base: float = 2.71828) -> float: +//| def log(x: float, base: float = e) -> float: //| """Return the logarithm of x to the given base. If base is not specified, //| returns the natural logarithm (base e) of x""" //| ...