MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / Complex

Class Complex

Source Code/20-10.rs:4–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22.3 + 6.5i*/
3mod complex {
4 pub struct Complex<Num> {
5 re: Num,
6 im: Num,
7 }
8 impl<Num> Complex<Num> {
9 pub fn from_re_im(re: Num, im: Num) -> Self {
10 Self { re, im }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected