Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

numjs

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numjs - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

2

package.json
{
"name": "numjs",
"version": "0.13.1",
"version": "0.13.2",
"description": "Like NumPy, in JavaScript",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -409,2 +409,5 @@ [![Build Status](https://travis-ci.org/nicolaspanel/numjs.png)](https://travis-ci.org/nicolaspanel/numjs) [![npm version](https://badge.fury.io/js/numjs.svg)](https://badge.fury.io/js/numjs) [![Bower version](https://badge.fury.io/bo/numjs.svg)](https://badge.fury.io/bo/numjs) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com/)

>
> nj.log(nj.exp(a))
array([-1, 0, 1])
>
> nj.sqrt(nj.abs(a))

@@ -411,0 +414,0 @@ array([ 1, 0, 1])

@@ -120,2 +120,11 @@ 'use strict';

/**
* Calculate the natural logarithm of all elements in the input array, element-wise.
* @param {(Array|NdArray|number)} x
* @returns {NdArray}
*/
function log (x) {
return NdArray.new(x).log();
}
/**
* Calculate the positive square-root of all elements in the input array, element-wise.

@@ -735,2 +744,3 @@ * @param {(Array|NdArray|number)} x

exp: exp,
log: log,
sqrt: sqrt,

@@ -737,0 +747,0 @@ power: power,

@@ -503,2 +503,15 @@ 'use strict';

/**
* Calculate the natural logarithm of all elements in the array, element-wise.
*
* @param {boolean} [copy=true] - set to false to modify the array rather than create a new one
* @returns {NdArray}
*/
NdArray.prototype.log = function (copy) {
if (arguments.length === 0) { copy = true; }
var arr = copy ? this.clone() : this;
ops.logeq(arr.selection);
return arr;
};
/**
* Calculate the positive square-root of all elements in the array, element-wise.

@@ -562,3 +575,3 @@ *

var variance = ops.sum(squares.selection) / (shapeSize - options.ddof) - mean * mean * shapeSize / (shapeSize - options.ddof);
return variance > 0 ? Math.sqrt(Math.abs(variance)) : 0;

@@ -565,0 +578,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc