MCPcopy Create free account
hub / github.com/cockroachdb/apd / SetString

Method SetString

bigint.go:888–900  ·  view source on GitHub ↗

SetString calls (big.Int).SetString.

(s string, base int)

Source from the content-addressed store, hash-verified

886
887// SetString calls (big.Int).SetString.
888func (z *BigInt) SetString(s string, base int) (*BigInt, bool) {
889 if i, err := strconv.ParseInt(s, base, 64); err == nil {
890 z.SetInt64(i)
891 return z, true
892 }
893 var tmp1 big.Int //gcassert:noescape
894 zi := z.inner(&tmp1)
895 if _, ok := zi.SetString(s, base); !ok {
896 return nil, false
897 }
898 z.updateInner(zi)
899 return z, true
900}
901
902// SetUint64 calls (big.Int).SetUint64.
903func (z *BigInt) SetUint64(x uint64) *BigInt {

Callers 15

toApdMethod · 0.95
TestBigInt64Function · 0.95
TestBigIntUint64Function · 0.95
TestBigIntModSqrtFunction · 0.95
TestBigIntGobEncodingFunction · 0.95
TestBigIntJSONEncodingFunction · 0.95
TestBigIntXMLEncodingFunction · 0.95
TestBigIntFillBytesFunction · 0.45
makeConstWithPrecisionFunction · 0.45
runBenchesFunction · 0.45
toMathMethod · 0.45

Calls 3

SetInt64Method · 0.95
innerMethod · 0.95
updateInnerMethod · 0.95

Tested by 15

toApdMethod · 0.76
TestBigInt64Function · 0.76
TestBigIntUint64Function · 0.76
TestBigIntModSqrtFunction · 0.76
TestBigIntGobEncodingFunction · 0.76
TestBigIntJSONEncodingFunction · 0.76
TestBigIntXMLEncodingFunction · 0.76
TestBigIntFillBytesFunction · 0.36
runBenchesFunction · 0.36
toMathMethod · 0.36
TestBigIntQuoFunction · 0.36