﻿ Python NumPy: Get the largest integer smaller or equal to the division of the inputs - w3resource

# Python NumPy: Get the largest integer smaller or equal to the division of the inputs

## Python NumPy Math, Statistics, Trigonometry and Linear algebra: Exercise-4 with Solution

Write a Python program to get the largest integer smaller or equal to the division of the inputs.

Sample Solution:-

Python Code:

``````import numpy as np
x = [1., 2., 3., 4.]
print("Original array:")
print(x)
print("Largest integer smaller or equal to the division of the inputs:")
print(np.floor_divide(x, 1.5))
```
```

Sample Output:

```Original array:
[1.0, 2.0, 3.0, 4.0]
Largest integer smaller or equal to the division of the inputs:
[ 0.  1.  2.  2.]
```

Python Code Editor:

```import numpy as np
x = [1., 2., 3., 4.]
print("Original array:")
print(x)
print("Largest integer smaller or equal to the division of the inputs:")
print(np.floor_divide(x, 1.5))```

Improve this sample solution and post your code through Disqus