out is the output array (which must have the same shape as the input).

If you construct it to be of the desired dtype, that'll be the dtype you get:

>>> arr = np.array([5.5, -7.2])
>>> out = np.empty_like(arr, dtype=np.int64)
>>> np.ceil(arr, out)
array([ 6, -7], dtype=int64)
>>> out
array([ 6, -7], dtype=int64)
Answer from NPE on Stack Overflow
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v2.4 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'ceil'>#
🌐
Codecademy
codecademy.com › docs › python:numpy › math methods › .ceil()
Python:NumPy | Math Methods | .ceil() | Codecademy
June 13, 2025 - The .ceil() function returns a NumPy array with the smallest integers greater than or equal to each element in x, returned as floats.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v2.2 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'ceil'>#
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v2.5.dev0 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'ceil'>#
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v2.1 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'ceil'>#
🌐
Programiz
programiz.com › python-programming › numpy › methods › ceil
NumPy ceil() (With Examples)
The ceil() function rounds up each element in an array to the nearest integer greater than or equal to each element. The ceil() function rounds up floating point element(s) in an array to the nearest integer greater than or equal to the array element. Example import numpy as np array1 = ...
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python numpy ceil() function
Python NumPy ceil() Function - Spark By {Examples}
March 27, 2024 - It returns the ceiling value of each array element and the elements in a returned array would be float data type. The numpy.ceil() is a mathematical function that returns the ceil value of an element array with float data type.
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-ceil-python
numpy.ceil() in Python - GeeksforGeeks
March 8, 2024 - Syntax : numpy.ceil(x[, out]) = ufunc ‘ceil’) Parameters : a : [array_like] Input array Return : The ceil of each element with float data-type. Code #1 : Working ... # Python program explaining # ceil() function import numpy as np in_array = [.5, 1.5, 2.5, 3.5, 4.5, 10.1] print ("Input array : \n", in_array) ceiloff_values = np.ceil(in_array) print ("\nRounded values : \n", ceiloff_values) in_array = [.53, 1.54, .71] print ("\nInput array : \n", in_array) ceiloff_values = np.ceil(in_array) print ("\nRounded values : \n", ceiloff_values) in_array = [.5538, 1.33354, .71445] print ("\nInput array : \n", in_array) ceiloff_values = np.ceil(in_array) print ("\nRounded values : \n", ceiloff_values) Output :
Find elsewhere
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › ceil
Python Numpy ceil() - Round Up Values | Vultr Docs
November 8, 2024 - The ceil() function provided by NumPy is a mathematical tool used for rounding up numerical values to the nearest integer. This function proves to be particularly useful in scenarios where precise upward rounding is necessary, such as in financial ...
🌐
NumPy
numpy.org › doc › 1.14 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v1.14 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'ceil'>¶
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v2.0 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'ceil'>#
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v2.3 Manual
numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'ceil'>#
🌐
SciPy
docs.scipy.org › doc › numpy-1.9.2 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v1.9 Manual
numpy.ceil(x[, out]) = <ufunc 'ceil'>¶ · Return the ceiling of the input, element-wise. The ceil of the scalar x is the smallest integer i, such that i >= x. It is often denoted as . See also · floor, trunc, rint · Examples · >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) >>> ...
🌐
SciPy
docs.scipy.org › doc › numpy-1.10.0 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v1.10 Manual
numpy.ceil(x[, out]) = <ufunc 'ceil'>¶ · Return the ceiling of the input, element-wise. The ceil of the scalar x is the smallest integer i, such that i >= x. It is often denoted as . See also · floor, trunc, rint · Examples · >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) >>> ...
🌐
Educative
educative.io › answers › what-is-the-ceil-function-in-numpy
What is the ceil function in numpy?
The ceil of a number x, which is scalar, is the smallest integer i, such that i >= x. numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'ceil'> A universal function ...
🌐
TutorialsPoint
tutorialspoint.com › return-the-ceil-of-the-inputs-in-numpy
Return the ceil of the inputs in Numpy
To return the ceil of the input, use the numpy.ceil() method in Python Numpy. The ceil of the scalar x is the smallest integer i, such that i >= x. It is often denoted as $\mathrm{\lceil X \rceil}$. The function returns the ceil of each element in x, with float dtype.
🌐
NumPy
numpy.org › doc › 1.15 › reference › generated › numpy.ceil.html
numpy.ceil — NumPy v1.15 Manual
February 8, 2025 - numpy.ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'ceil'>¶
🌐
Javatpoint
javatpoint.com › numpy-ceil
numpy.ceil() in Python - Javatpoint
numpy.ceil() in Python with NumPy Introduction, Environment Setup, ndarray, Data Types, Array Creation, Attributes, Existing Data, Indexing and Slicing, Advanced Indexing, Broadcasting, Array Manipulation, Matrix Library, Matplotlib etc.
🌐
Studytonight
studytonight.com › numpy › numpy-ceil-function
NumPy ceil() function - Studytonight
The numpy.ceil() function is used to return the ceil of the elements of an array. The ceil value of any scalar value x is the smallest integer i in a way such that i >= x. For example, the ceil value for 5.6 will be 6.