MCPcopy
hub / github.com/angular/angular / addBigInt

Function addBigInt

packages/service-worker/worker/src/sha1.ts:192–207  ·  view source on GitHub ↗
(x: string, y: string)

Source from the content-addressed store, hash-verified

190
191// x and y decimal, lowest significant digit first
192function addBigInt(x: string, y: string): string {
193 let sum = '';
194 const len = Math.max(x.length, y.length);
195 for (let i = 0, carry = 0; i < len || carry; i++) {
196 const tmpSum = carry + +(x[i] || 0) + +(y[i] || 0);
197 if (tmpSum >= 10) {
198 carry = 1;
199 sum += tmpSum - 10;
200 } else {
201 carry = 0;
202 sum += tmpSum;
203 }
204 }
205
206 return sum;
207}
208
209function numberTimesBigInt(num: number, b: string): string {
210 let product = '';

Callers 2

byteStringToDecStringFunction · 0.70
numberTimesBigIntFunction · 0.70

Calls 1

maxMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…