MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / parseNumericValue

Function parseNumericValue

static/utils.ts:95–106  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

93const ptxFloat64 = /^0[dD]([0-9a-fA-F]{16})$/;
94
95function parseNumericValue(value: string): bigInt.BigInteger | null {
96 const hexMatch = hexLike.exec(value) || hexLike2.exec(value);
97 if (hexMatch) return bigInt(hexMatch[2], 16);
98
99 const hexMatchPTX = ptxFloat32.exec(value) ?? ptxFloat64.exec(value);
100 if (hexMatchPTX) return bigInt(hexMatchPTX[1], 16);
101
102 const decMatch = decimalLike.exec(value);
103 if (decMatch) return bigInt(decMatch[2]);
104
105 return null;
106}
107
108export function getNumericToolTip(value: string, digitSeparator?: string): string | null {
109 const formatNumber = (num: bigInt.BigInteger, base: number, chunkSize: number) => {

Callers 1

getNumericToolTipFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected