MCPcopy Create free account
hub / github.com/apitable/apitable / plus

Function plus

packages/core/src/utils/number.ts:300–303  ·  view source on GitHub ↗
(num1: number, num2: number)

Source from the content-addressed store, hash-verified

298 * Precise addition (to resolve loss of precision)
299 */
300export function plus(num1: number, num2: number): number {
301 const baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
302 return (times(num1, baseNum) + times(num2, baseNum)) / baseNum;
303}
304
305/**
306 * Precise subtraction (to resolve loss of precision)

Callers 3

funcMethod · 0.90
funcMethod · 0.90

Calls 3

digitLengthFunction · 0.85
timesFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected