Socket
Book a DemoInstallSign in
Socket

gsl-sf

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gsl-sf

special functions of GNU Scientific Library for JS

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

NPM version

gsl-sf-js

special functions of GNU Scientific Library for JS

Installation

Via npm:

npm install gsl-sf

To use it inside node:

var sf = require("gsl-sf");

API

For a full documentation of the original C functions, visit https://www.gnu.org/software/gsl/manual/html_node/Special-Functions.html#Special-Functions. The prefix gsl_sf_ was removed from the original function definitions. For example, while in C you would call gsl_sf_gamma (x) to evaluate the Gamma function at value x , the function is exported simply as gamma(x).

Example:

gamma(3); 

Output:

2

Alternatively, we can use the result object or the result_e10 class to store the return value of the function:

var res = new sf.result()
sf.gamma(3, res)

The result object has two keys: val contains the value and err contains an estimate of the absolute error.

Code:

console.log("The value is " + res.val + ", the error is " + res.err)

Output:

The value is 2, the error is 4.440892098500626e-16

Keywords

mathematical-functions

FAQs

Package last updated on 25 Dec 2014

Did you know?

Socket

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.

Install

Related posts