Browse Source

Add Number >> ln1p.

Herby Vojčík 6 years ago
parent
commit
832734f731
3 changed files with 30 additions and 0 deletions
  1. 2 0
      API-CHANGES.txt
  2. 24 0
      src/Kernel-Objects.js
  3. 4 0
      src/Kernel-Objects.st

+ 2 - 0
API-CHANGES.txt

@@ -5,6 +5,8 @@
 + JSObjectProxy class >>
   + null
   + undefined
++ Number >>
+  + ln1p
 
 - ClassBuilder >>
   - basicClass:instanceVariableNames:

+ 24 - 0
src/Kernel-Objects.js

@@ -4141,6 +4141,30 @@ messageSends: []
 }),
 $globals.Number);
 
+$core.addMethod(
+$core.method({
+selector: "ln1p",
+protocol: "mathematical functions",
+fn: function (){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return Math.log1p(self);;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"ln1p",{},$globals.Number)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "ln1p\x0a\x09<inlineJS: 'return Math.log1p(self);'>",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.Number);
+
 $core.addMethod(
 $core.method({
 selector: "log",

+ 4 - 0
src/Kernel-Objects.st

@@ -1046,6 +1046,10 @@ ln
 	<inlineJS: 'return Math.log(self);'>
 !
 
+ln1p
+	<inlineJS: 'return Math.log1p(self);'>
+!
+
 log
 	<inlineJS: 'return Math.log(self) / Math.LN10;'>
 !