Home Manual Reference Source

Overview

Installation

Can be managed using jspm or npm.

jspm

jspm install npm:@aureooms/js-rational

npm

npm install @aureooms/js-rational --save

Usage

The code needs a ES2015+ polyfill to work, for example regenerator-runtime/runtime.

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

Then

const rational = require( '@aureooms/js-rational' ) ;
// or
import * as rational from '@aureooms/js-rational' ;

Example

import { _add , _sub , _mul , _div } from '@aureooms/js-rational' ;
import * as integer from '@aureooms/js-integer' ;
const add = _add( integer ) ;
const sub = _sub( integer ) ;
const mul = _mul( integer ) ;
const div = _div( integer ) ;