Opis Rust

Opis is an arithmetic library for integer numbers written in Rust.

Usage

In Cargo.toml

```

[dependencies] opis = "1.0.0"

```

In your rust file

```

use opis::Int;

```

Features

API

Conversion Functions

From Str

```

let integer: Int = Int::from_str("6747", 10)?;

```

To Str

```

let binarystr: String = integer.tostr(2);

```

Arithmetic Functions

Addition(add)

```

let s = inta.add(&int2b);

```

Subtraction(sub)

```

let d = inta.sub(&intb).unwrap();

```

Multiplication(mul)

```

let p = inta.mul(&intb);

```

Division(div)

```

let q = inta.div(&intb).unwrap();

```

Remainder(rem)

```

let r = inta.rem(&intb).unwrap();

```

Modulo(modulo)

```

let m = inta.modulo(&intb).unwrap();

```

Exponentiation(pow)

```

let p = inta.pow(&inte);

```

Modular Inverse(mod_inv)

```

let mi = inta.modinv(&int_m);

```

Comparison Functions

```

let ans1: bool = inta.isgreater(&intb);

let ans2: bool = inta.isless(&intb);

let ans3: bool = inta.isequal(&intb);

```

Performance

N/A

Future

Contribution

Pull requests, bug reports and any kind of suggestion are welcome.

2021-11-05