Git Product home page Git Product logo

big-js's Introduction

     ___   _________     __ ____
    / _ ) /  _/ ___/ __ / // __/
   / _  |_/ // (_ /_/ // /_\ \  
  /____//___/\___/(_)___//___/  

Big.js An Arbitrary Precision Math Library for JavaScript

Overview

Big.js provides a class definition (Big) to handle numbers of any precision and perform mathematical operations on them within JavaScript. Create a "Big" object in either of the the following ways:

new Big("123.456"); // --> [Object]

OR:

Big.parse("567.890"); // --> [Object]

Method Support

Version 0.7.*: lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo, equals

Version 0.8.*: plus, minus, negate, clone

Runing Tests

The unit test suite is a stratified-randomized differential tester which runs in UNIX environments and is designed for the VT100 shell (for colors). It has a small list of system requirements.

  1. Mozilla's Rhino Shell: This is available from Mozilla for free. It is essentially a JavaScript interpreter/shell environment which we use to execute the library code quickly and programmatically (and without a browser).

  2. The "apcalc" UNIX utility. On debian variants it can be installed with the command "apt-get install apcalc". It is a programming language built around an infinite precision math library used here as an "oracle" for the differential testing.

To run the unit tests, first navigate to the root of the project and run:

make tests

Then, navigate to tests/differential and run:

./differential.sh

You can specify how many tests to run by adding an argument:

./differential.sh 200

TODO

  • Convert to Node.js module for NPM
  • Convert multiplication to FFT
  • Exponentiation
  • Trigonometric functions
  • Logarithms
  • Base parsing

big-js's People

Contributors

whatgoodisaroad avatar kirkpatrickc avatar

Watchers

James Cloos avatar Luis Heredia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.