We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb878a3 commit 4a598d0Copy full SHA for 4a598d0
tests/snippets/floats.py
@@ -140,6 +140,8 @@
140
assert 3 ** 2.0 == 9.0
141
142
assert (1.7).real == 1.7
143
+assert (1.7).imag == 0.0
144
+assert (1.7).conjugate() == 1.7
145
assert (1.3).is_integer() == False
146
assert (1.0).is_integer() == True
147
vm/src/obj/objfloat.rs
@@ -364,6 +364,16 @@ impl PyFloat {
364
zelf
365
}
366
367
+ #[pyproperty(name = "imag")]
368
+ fn imag(&self, _vm: &VirtualMachine) -> f64 {
369
+ 0.0f64
370
+ }
371
+
372
+ #[pymethod(name = "conjugate")]
373
+ fn conjugate(zelf: PyRef<Self>, _vm: &VirtualMachine) -> PyFloatRef {
374
+ zelf
375
376
377
#[pymethod(name = "is_integer")]
378
fn is_integer(&self, _vm: &VirtualMachine) -> bool {
379
let v = self.value;
0 commit comments