From bfdd5dbc41e60d3193991d3687456515f1c17b39 Mon Sep 17 00:00:00 2001 From: Rupa-Rd Date: Mon, 20 May 2024 23:14:25 +0530 Subject: [PATCH] Additional datatype longdouble is added --- contrib/numpy/datatypes.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contrib/numpy/datatypes.md b/contrib/numpy/datatypes.md index 12690b9..f58cee5 100644 --- a/contrib/numpy/datatypes.md +++ b/contrib/numpy/datatypes.md @@ -216,6 +216,20 @@ The `timedelta64()` used to find the difference between the `datetime64()`. The # 366 days # timedelta64[D] ``` +## Additional Data Type (`longdouble`) +`longdouble` is a data type that provides higher precision than the standard double-precision floating-point (`float64`) type. + +``` python + import numpy as np + + arr = np.longdouble([1.222222, 4.44, 45.55]) + + print(arr, arr.dtype) + + # Output: + # [1.222222 4.44 45.55] float128 +``` + # Data Type Conversion `astype()` function is used to the NumPy object from one type to another type.