MCPcopy Create free account
hub / github.com/DOSNetwork/core / InitString

Method InitString

group/mod/int.go:103–110  ·  view source on GitHub ↗

InitString inits the Int to a rational fraction n/d specified with a pair of strings in a given base.

(n, d string, base int, m *big.Int)

Source from the content-addressed store, hash-verified

101// InitString inits the Int to a rational fraction n/d
102// specified with a pair of strings in a given base.
103func (i *Int) InitString(n, d string, base int, m *big.Int) *Int {
104 i.M = m
105 i.BO = BigEndian
106 if _, succ := i.SetString(n, d, base); !succ {
107 panic("InitString: invalid fraction representation")
108 }
109 return i
110}
111
112// Return the Int's integer value in hexadecimal string representation.
113func (i *Int) String() string {

Callers 1

NewIntStringFunction · 0.80

Calls 1

SetStringMethod · 0.95

Tested by

no test coverage detected