Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@stdlib/math-base-special-log1p
Advanced tools
Readme
Evaluate the natural logarithm of
1+x
.
npm install @stdlib/math-base-special-log1p
var log1p = require( '@stdlib/math-base-special-log1p' );
Evaluates the natural logarithm of 1+x
.
var v = log1p( 4.0 );
// returns ~1.609
v = log1p( -1.0 );
// returns -Infinity
v = log1p( Infinity );
// returns Infinity
v = log1p( 0.0 );
// returns 0.0
v = log1p( -0.0 );
// returns -0.0
v = log1p( NaN );
// returns NaN
For x < -1
, the function returns NaN
, as the natural logarithm is not defined for negative numbers.
var v = log1p( -2.0 );
// returns NaN
var randu = require( '@stdlib/random-base-randu' );
var round = require( '@stdlib/math-base-special-round' );
var log1p = require( '@stdlib/math-base-special-log1p' );
var x;
var i;
for ( i = 0; i < 100; i++ ) {
x = round( randu() * 100.0 );
console.log( log1p( x ) );
}
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2021. The Stdlib Authors.
FAQs
Evaluate the natural logarithm of 1+x.
We found that @stdlib/math-base-special-log1p demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).