🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

accurate-core

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accurate-core

An lightweight and high performance precision calculation for JavaScript and Node.js. 解决 JavaScript 与 Node.js 精度计算(小数、浮点数计算精度)问题,轻量级、性能较高。

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

Accurate-core · NPM version NPM downloads Build Status Coverage Status code style: prettier

  • An lightweight and high performance precision calculation for JavaScript and Node.js.
  • 解决 JavaScript 与 Node.js 精度计算(浮点数计算精度)问题,轻量级、性能较高。

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Opera
Opera
IE8+ Edge+last 10 versionslast 10 versionslast 2 versionslast 2 versionslast 2 versions

Install

npm i accurate-core -S
or
yarn add accurate-core

Features

  • Lightweight.

  • High performance.

  • No dependencies.

  • Runs on any JavaScript engine.

  • Is easily extensible.

  • Open source.

  • 轻量级。

  • 性能较高。

  • 没有依赖。

  • 运行在任何 JavaScript 引擎。

  • 易于扩展。

  • 开源的。

More features

Usage

import accurateCalc, {
  add, addition, subtract, subtraction, multiply, mul, multiplication, division, divide, modulo, modulus
} from 'accurate-core'
or
const accurateCalc, {
  add, addition, subtract, subtraction, multiply, mul, multiplication, division, divide, modulo, modulus
} = require('accurate-core')

. add(加法)

>
1.1 + 0.3
accurateCalc.add(1.1, 0.3)
addition(1.1, 0.3)

<-
1.4000000000000001
1.4
1.4

. subtract(减法)

>
1.1 - 0.2
accurateCalc.subtract(1.1, 0.2)
subtraction(1.1, 0.2)

<-
0.9000000000000001
0.9
0.9

. multiply(乘法)

>
1.1 * 0.1
accurateCalc.multiply(1.1, 0.1)
accurateCalc.mul(1.1, 0.1)
multiplication(1.1, 0.1)

<-
0.11000000000000001
0.11
0.11
0.11

. division(除法)

>
1.1 / 10
accurateCalc.division(1.1, 10)
accurateCalc.divide(1.1, 10)

<-
0.11000000000000001
0.11
0.11

. modulo(取模)

>
1.1 % 1
accurateCalc.modulo(1.1, 1)
accurateCalc.modulus(1.1, 1)

<-
0.10000000000000009
0.1
0.1

More

Keywords

accurate-core

FAQs

Package last updated on 23 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts