MCPcopy Create free account
hub / github.com/LiuXin-Developer/easyMath / addition

Function addition

src/index.js:127–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126// 加法
127const addition = function () {
128 // 计算倍数
129 let maxDecimalDigits = getMaxDecimalDigits(arguments)
130 let times = Math.pow(10, maxDecimalDigits);
131 // 计算结果
132 let results = 0
133 for (let i = 0; i < arguments.length; i++) {
134 results += toInteger(arguments[i], maxDecimalDigits)
135 }
136 results = results / times
137 // 返回结果
138 return results
139
140}
141// 加法别名
142const jiafa = addition
143const jia = addition

Callers

nothing calls this directly

Calls 2

getMaxDecimalDigitsFunction · 0.85
toIntegerFunction · 0.85

Tested by

no test coverage detected