mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: change Mp{int,flt} functions into methods
Also give them more idiomatic Go names. Adding godocs is outside the scope of this CL. (Besides, the method names almost all directly parallel an underlying math/big.Int or math/big.Float method.) CL prepared mechanically with sed (for rewriting mpint.go/mpfloat.go) and gofmt (for rewriting call sites). Passes toolstash -cmp. Change-Id: Id76f4aee476ba740f48db33162463e7978c2083d Reviewed-on: https://go-review.googlesource.com/20909 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
5fb6aa3e09
commit
d3253876f2
20 changed files with 315 additions and 315 deletions
|
|
@ -343,7 +343,7 @@ func gdata(nam *Node, nr *Node, wid int) {
|
|||
|
||||
case CTFLT:
|
||||
s := Linksym(nam.Sym)
|
||||
f := mpgetflt(nr.Val().U.(*Mpflt))
|
||||
f := nr.Val().U.(*Mpflt).Float64()
|
||||
switch nam.Type.Etype {
|
||||
case TFLOAT32:
|
||||
s.WriteFloat32(Ctxt, nam.Xoffset, float32(f))
|
||||
|
|
@ -375,8 +375,8 @@ func gdata(nam *Node, nr *Node, wid int) {
|
|||
|
||||
func gdatacomplex(nam *Node, cval *Mpcplx) {
|
||||
t := Types[cplxsubtype(nam.Type.Etype)]
|
||||
r := mpgetflt(&cval.Real)
|
||||
i := mpgetflt(&cval.Imag)
|
||||
r := cval.Real.Float64()
|
||||
i := cval.Imag.Float64()
|
||||
s := Linksym(nam.Sym)
|
||||
|
||||
switch t.Etype {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue