Skip to content

anwarhahjjeffersongeorge/foft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VersionBuild Status codecov

license JavaScript Style Guide


foft

Syntactic sugar for discontinuous (mathematical) functions.

It Is

  • A lot of syntactic sugar
  • For investigating the results of known arithmetic expressions provided as functions in JavaScript over specified evaluation ranges,
  • For investigating floating-point error tendencies in a JavaScript environment, and
  • An ECMAScript module for browsers or nodejs.

It Is not

  • Fast,
  • A comprehensive calculator,
  • Immune to inaccuracies,
  • A computer algebra system,
  • An equation solver, or
  • An expression parser.

Usage:

Foft exports a single class, Foft that can create an instance as well as provide some static utilities.

Example:

import {Foft} from 'foftjs';
m = new Foft({
    terms: [t => 2*t],
    range: [0, 10],
    segmentDivisor: 10 // 10
});
[...m] // Array(11) [ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 ] // 10+1

Generally, a Foft instance can evaluate:

  1. Its terms: Function or Foft instances that should generally receive and return
  • Numbers
  • Arrays of Numbers,
  • Nested Arrays of Numbers, or
  • TypedArrays.
  1. Some of the properties of its terms(1).

Development Guidelines

Testing

in nodejs

Run npm test

Documentation

Run npm run-script docs

About

Syntactic sugar for discontinuous (mathematical) functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages