Lines Matching refs:n0
49 fn compare(n0: &BigInt, n1: &BigInt) -> Result<()> { in compare()
50 match n0.compare_big_int(n1) { in compare()
51 0 => trace_println!("{} == {}.", n0, n1), in compare()
52 res if res > 0 => trace_println!("{} > {}.", n0, n1), in compare()
53 _ => trace_println!("{} < {}.", n0, n1), in compare()
58 fn convert(n0: &BigInt, n1: &BigInt) -> Result<()> { in convert()
61 n0, in convert()
62 n0.convert_to_octet_string().unwrap() in convert()
68 fn add(n0: &BigInt, n1: &BigInt) -> Result<()> { in add()
69 let res = BigInt::add(n0, n1); in add()
70 trace_println!("{} + {} = {}.", n0, n1, res); in add()
74 fn sub(n0: &BigInt, n1: &BigInt) -> Result<()> { in sub()
75 let res = BigInt::sub(n0, n1); in sub()
76 trace_println!("{} - {} = {}.", n0, n1, res); in sub()
80 fn multiply(n0: &BigInt, n1: &BigInt) -> Result<()> { in multiply()
81 let res = BigInt::multiply(n0, n1); in multiply()
82 trace_println!("{} * {} = {}.", n0, n1, res); in multiply()
86 fn divide(n0: &BigInt, n1: &BigInt) -> Result<()> { in divide()
87 let (quot, rem) = BigInt::divide(n0, n1); in divide()
88 trace_println!("{} / {} = {}, ramians {}.", n0, n1, quot, rem); in divide()
92 fn module(n0: &BigInt, n1: &BigInt) -> Result<()> { in module()
93 let res = BigInt::module(n0, n1); in module()
94 trace_println!("{} % {} = {}.", n0, n1, res); in module()
104 let mut n0 = BigInt::new(64); in invoke_command() variables
107 n0.convert_from_octet_string(n0_buffer.buffer(), 0)?; in invoke_command()
111 Command::Compare => compare(&n0, &n1), in invoke_command()
112 Command::Convert => convert(&n0, &n1), in invoke_command()
113 Command::Add => add(&n0, &n1), in invoke_command()
114 Command::Sub => sub(&n0, &n1), in invoke_command()
115 Command::Multiply => multiply(&n0, &n1), in invoke_command()
116 Command::Divide => divide(&n0, &n1), in invoke_command()
117 Command::Module => module(&n0, &n1), in invoke_command()