*Is there any Mathematical package which I can use to perform Math functions in Rust Programs like tan(), sqrt(), round()*

*If yes please tell how to use and how it can be implemented in programs*

*Is there any Mathematical package which I can use to perform Math functions in Rust Programs like tan(), sqrt(), round()*

*If yes please tell how to use and how it can be implemented in programs*

How about f32 - Rust?

Primitive types such a `f32`

and `f64`

have many mathematical functions defined on them.

1 Like

@RedDocMD This is okay but can you pls show example how to use them in Rust

Since Im new to this Programming Language.

Something like:

```
let x = std::f32::consts::FRAC_PI_4; // pi / 4
let y = x.tan(); // Should be approx 1
println!("tan({}) = {}", x, y);
```

3 Likes

A simple example:

Documentation on the methods provided for f64 is here:

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.