math.complex: make fields public
parent
49d6c26da4
commit
a5d61f6da0
|
@ -7,6 +7,7 @@ module complex
|
||||||
import math
|
import math
|
||||||
|
|
||||||
struct Complex {
|
struct Complex {
|
||||||
|
pub:
|
||||||
re f64
|
re f64
|
||||||
im f64
|
im f64
|
||||||
}
|
}
|
||||||
|
|
|
@ -781,3 +781,9 @@ fn test_complex_acsch() {
|
||||||
// Some issue with precision comparison in f64 using == operator hence serializing to string
|
// Some issue with precision comparison in f64 using == operator hence serializing to string
|
||||||
assert result.str().eq(c2.str())
|
assert result.str().eq(c2.str())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn test_complex_re_im() {
|
||||||
|
c := cmplx.complex(2.1, 9.05)
|
||||||
|
assert c.re == 2.1
|
||||||
|
assert c.im == 9.05
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue