This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
float.go
51 lines (41 loc) · 1.53 KB
/
float.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gocpy
/*
#include "Python.h"
#include "macro.h"
*/
import "C"
import "unsafe"
//Float : https://docs.python.org/3/c-api/float.html#c.PyFloat_Type
var Float = togo((*C.PyObject)(unsafe.Pointer(&C.PyFloat_Type)))
//PyFloat_Check : https://docs.python.org/3/c-api/float.html#c.PyFloat_Check
func PyFloat_Check(p *PyObject) bool {
return C._go_PyFloat_Check(toc(p)) != 0
}
//PyFloat_CheckExact : https://docs.python.org/3/c-api/float.html#c.PyFloat_CheckExact
func PyFloat_CheckExact(p *PyObject) bool {
return C._go_PyFloat_CheckExact(toc(p)) != 0
}
//PyFloat_FromDouble : https://docs.python.org/3/c-api/float.html#c.PyFloat_FromDouble
func PyFloat_FromDouble(v float64) *PyObject {
return togo(C.PyFloat_FromDouble(C.double(v)))
}
//PyFloat_FromString : https://docs.python.org/3/c-api/float.html#c.PyFloat_FromString
func PyFloat_FromString(str *PyObject) *PyObject {
return togo(C.PyFloat_FromString(toc(str)))
}
//PyFloat_AsDouble : https://docs.python.org/3/c-api/float.html#c.PyFloat_AsDouble
func PyFloat_AsDouble(obj *PyObject) float64 {
return float64(C.PyFloat_AsDouble(toc(obj)))
}
//PyFloat_GetInfo : https://docs.python.org/3/c-api/float.html#c.PyFloat_GetInfo
func PyFloat_GetInfo() *PyObject {
return togo(C.PyFloat_GetInfo())
}
//PyFloat_GetMax : https://docs.python.org/3/c-api/float.html#c.PyFloat_GetMax
func PyFloat_GetMax() float64 {
return float64(C.PyFloat_GetMax())
}
//PyFloat_GetMin : https://docs.python.org/3/c-api/float.html#c.PyFloat_GetMin
func PyFloat_GetMin() float64 {
return float64(C.PyFloat_GetMin())
}