npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

calculation_formula

v1.0.8

Published

YDT

Downloads

23

Readme

js计算公共仓库

安装:cnpm i calculation_formula

具体方法:

版本1.0.1新增

1.计算公式:支持带括号和计算次方(^)

import {compute} from 'calculation_formula';
//@param str 字符串如:'(100^2-587)*100+(1024*2+1)+0.05*3*100'
//return number
compute(str);

2.解决运算精度丢失问题——加法

import {add} from 'calculation_formula';
//@param arg1 被加数
//@param arg2 加数
//return number
add(arg1,arg2)

3.解决运算精度丢失问题——减法

import {cut} from 'calculation_formula';
//@param arg1 被减数1
//@param arg2 减数2
//return number
cut(arg1,arg2)

4.解决运算精度丢失问题——乘法

import {multiple} from 'calculation_formula';
//@param arg1 被乘数
//@param arg2 乘数
//return number
multiple(arg1,arg2)

5.解决运算精度丢失问题——除数

import {divide} from 'calculation_formula';
//@param arg1 被除数
//@param arg2 除数
//return number
divide(arg1,arg2)

6.四舍五入保留小数

import {keepDecimal} from 'calculation_formula';
//@param num  数值
//@param decimal 小数位数
//return number
keepDecimal(num,decimal)

7.最小为0

import {lowestZero} from 'calculation_formula';
//@param num  数值
//return number
lowestZero(num)

8.是否为浮点数

import {isFloat} from 'calculation_formula';
//@param num  数值
//return number
isFloat(num)

版本1.0.2新增

9.数字千分位

import {formatNumberToThousand} from 'calculation_formula';
//@param num  数值
//return string
formatNumberToThousand(num)

版本1.0.3新增

10.平均数

import {calculationAvg} from 'calculation_formula';
// @param Array 数组
// @returns number
calculationAvg(array)

11.方差

import {calculationVar} from 'calculation_formula';
// @param Array 数组
// @returns number
calculationVar(array)

12.协方差

import {calculationCovariance} from 'calculation_formula';
// @param arrayX:Array,arrayY:Array 数组
// @returns number
calculationCovariance(arrayX,arrayY)

13.相关性系数

import {calculationCorrelation} from 'calculation_formula';
// @param arrayX:Array,arrayY:Array 数组
// @returns number
calculationCorrelation(arrayX,arrayY)

14.相关性矩阵

import {calculationCorrelationMatrix} from 'calculation_formula';
// @param Array 二位数组 示例:[[第一列],[第二列],[第三列],[第四列]]
// @returns Array 示例:[[第一行],[第二行],[第三行],[第四行]]
calculationCorrelationMatrix()

版本1.0.4新增

15.标准差

import {calculationStandardDeviation} from 'calculation_formula';
// @param Array 数组
// @returns number
calculationStandardDeviation(array)

版本1.0.5

增加说明文档

版本1.0.6

优化加减乘除方法和公式计算方法

版本1.0.7

调整说明文档

版本1.0.8

调整说明文档