FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/runtime/PythonTypes/PyFloat.IComparable.cs at master · cpgames/pythonnet · GitHub
cpgames
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
runtime
/
PythonTypes
/
PyFloat.IComparable.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (26 loc) · 943 Bytes
Breadcrumbs
pythonnet
/
src
/
runtime
/
PythonTypes
/
PyFloat.IComparable.cs
Copy path
File metadata and controls
34 lines (26 loc) · 943 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using
System
;
namespace
Python
.
Runtime
;
partial
class
PyFloat
:
IComparable
<
double
>
,
IComparable
<
float
>
,
IEquatable
<
double
>
,
IEquatable
<
float
>
,
IComparable
<
PyFloat
?
>
,
IEquatable
<
PyFloat
?
>
{
public
override
bool
Equals
(
object
o
)
{
using
var
_
=
Py
.
GIL
(
)
;
return
o
switch
{
double
f64
=>
this
.
Equals
(
f64
)
,
float
f32
=>
this
.
Equals
(
f32
)
,
_
=>
base
.
Equals
(
o
)
,
}
;
}
public
int
CompareTo
(
double
other
)
=>
this
.
ToDouble
(
)
.
CompareTo
(
other
)
;
public
int
CompareTo
(
float
other
)
=>
this
.
ToDouble
(
)
.
CompareTo
(
other
)
;
public
bool
Equals
(
double
other
)
=>
this
.
ToDouble
(
)
.
Equals
(
other
)
;
public
bool
Equals
(
float
other
)
=>
this
.
ToDouble
(
)
.
Equals
(
other
)
;
public
int
CompareTo
(
PyFloat
?
other
)
{
return
other
is
null
?
1
:
this
.
CompareTo
(
other
.
BorrowNullable
(
)
)
;
}
public
bool
Equals
(
PyFloat
?
other
)
=>
base
.
Equals
(
other
)
;
}
Back
|
FazBrowse Home
|
New Git URL