Home Manual Reference Source

Overview

Installation

Can be managed using yarn, npm, or jspm.

yarn

yarn add @combinatorics/factorial

npm

npm install @combinatorics/factorial --save

jspm

jspm install npm:@combinatorics/factorial

Usage

:warning: Depending on your environment, the code may require regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

First, require the polyfill at the entry point of your application

await import( 'regenerator-runtime/runtime.js' ) ;
// or
import 'regenerator-runtime/runtime.js' ;

Then, import the library where needed

const factorial = await import( '@combinatorics/factorial' ) ;
// or
import * as factorial from '@combinatorics/factorial' ;

Examples

import {factorial} from '@combinatorics/factorial' ;
factorial(18) ; // 6402373705728000

More examples in the test files.