GithubHelp home page GithubHelp logo

victoriaquasar / decimal.js.macro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gtkatakura/decimal.js.macro

0.0 0.0 0.0 1.06 MB

A babel-macro to transpile arithmetic expressions to `decimal.js`

License: MIT License

JavaScript 100.00%

decimal.js.macro's Introduction

decimal.js.macro

Build Status npm version MIT License semantic-release

Usage

import decimal from 'decimal.js.macro'

const a = decimal(1)
const b = decimal(a - 3 * 4 / 5)
const c = decimal(a - 3 + 4 - 5)
const d = decimal(1 ** 2 ** 3)

           

import { Decimal as _Decimal } from 'decimal.js';


const a = _Decimal('1');
const b = _Decimal(a).sub(_Decimal(_Decimal('3').mul('4')).div('5'));
const c = _Decimal(_Decimal(_Decimal(a).sub('3')).add('4')).sub('5');
const d = _Decimal('1').pow(_Decimal('2').pow('3'));

Contributors

Thanks goes to these wonderful people (emoji key):


gtkatakura

💻 🤔 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

decimal.js.macro's People

Contributors

gtkatakura 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.