> ## Documentation Index
> Fetch the complete documentation index at: https://docs.starknet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# core::felt252_div

Performs division on `felt252` values in Cairo's finite field.
Unlike regular integer division, `felt252` division returns a field element n that satisfies
the equation: n \* rhs ≡ lhs (mod P), where P is the `felt252` prime.

## Signature

```rust theme={null}
pub extern fn felt252_div(lhs: felt252, rhs: NonZero) -> felt252 nopanic;
```

## Examples

```rust theme={null}
use core::felt252_div;

// Division with 0 remainder works the same way as integer division.
assert!(felt252_div(4, 2) == 2);

// Division with non 0 remainder returns a field element n where n * 3 ≡ 4 (mod P)
assert!(felt252_div(4, 3) ==
1206167596222043737899107594365023368541035738443865566657697352045290673495);

```
