FloatAsDouble => Float64
This commit is contained in:
@@ -8,5 +8,5 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
x := math.Sqrt(py.Float(2))
|
x := math.Sqrt(py.Float(2))
|
||||||
c.Printf(c.Str("sqrt(2) = %f\n"), x.FloatAsDouble())
|
c.Printf(c.Str("sqrt(2) = %f\n"), x.Float64())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func main() {
|
|||||||
math := py.ImportModule(c.Str("math"))
|
math := py.ImportModule(c.Str("math"))
|
||||||
sqrt := math.GetAttrString(c.Str("sqrt"))
|
sqrt := math.GetAttrString(c.Str("sqrt"))
|
||||||
sqrt2 := sqrt.CallOneArg(py.Float(2))
|
sqrt2 := sqrt.CallOneArg(py.Float(2))
|
||||||
c.Printf(c.Str("sqrt(2) = %f\n"), sqrt2.FloatAsDouble())
|
c.Printf(c.Str("sqrt(2) = %f\n"), sqrt2.Float64())
|
||||||
sqrt2.DecRef()
|
sqrt2.DecRef()
|
||||||
sqrt.DecRef()
|
sqrt.DecRef()
|
||||||
math.DecRef()
|
math.DecRef()
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ func Float(v float64) *Object
|
|||||||
//go:linkname FloatFromSring C.PyFloat_FromString
|
//go:linkname FloatFromSring C.PyFloat_FromString
|
||||||
func FloatFromSring(v *Object) *Object
|
func FloatFromSring(v *Object) *Object
|
||||||
|
|
||||||
// llgo:link (*Object).FloatAsDouble C.PyFloat_AsDouble
|
// llgo:link (*Object).Float64 C.PyFloat_AsDouble
|
||||||
func (o *Object) FloatAsDouble() float64 { panic("unreachable") }
|
func (o *Object) Float64() float64 { panic("unreachable") }
|
||||||
|
|||||||
Reference in New Issue
Block a user