You know how a 64-bit 0.3 shows up as 0.3 instead of its actual value, 0.299999999999999988897769753748434595763683319091796875?

It's a similar story here. numpy.finfo(numpy.float16).max is a float16, and those have very little precision. The exact mathematical value of the float16 is 65504, but a float16 doesn't have 5 decimal digits of precision, and by default, NumPy doesn't want to show you false precision.

It prints 65500.0, because '65500.0' is the shortest decimal representation (in terms of significant digits) such that converting the string back to float16 reproduces the original number.

Answer from user2357112 on Stack Overflow
🌐
Note.nkmk.me
note.nkmk.me › home › python
Maximum and Minimum float Values in Python | note.nkmk.me
August 11, 2023 - You can obtain the maximum representable float value with sys.float_info.max. e+XXX means 10 to the power of XXX.
🌐
TutorialsPoint
tutorialspoint.com › article › get-the-machine-limits-information-for-float-types-in-python
Get the Machine limits information for float types in Python
February 24, 2022 - float16 limits: Minimum: -65500.0 Maximum: 65500.0 Precision: 3 digits float32 limits: Minimum: -3.4028235e+38 Maximum: 3.4028235e+38 Precision: 6 digits float64 limits: Minimum: -1.7976931348623157e+308 Maximum: 1.7976931348623157e+308 Precision: ...
🌐
Python.org
discuss.python.org › python help
Finding max value in a series of floats - Python Help - Discussions on Python.org
April 15, 2024 - I am trying to write code that takes a row of floats from a csv file, representing the average temperature in a given month over the course of 70 years, and returns the highest float value of them all. When I print the variable holding the float values, in this case val, I get something similar to: 10.56 12.35 11.35 etc.
🌐
TutorialsPoint
tutorialspoint.com › What-is-the-maximum-value-of-float-in-Python
What is the maximum value of float in Python?
Maximum float value: 1.7976931348623157e+308 Minimum positive normalized float: 2.2250738585072014e-308 Float epsilon: 2.220446049250313e-16 · The maximum float value 1.7976931348623157e+308 uses scientific notation.
🌐
Apache MXNet
mxnet.apache.org › versions › 1.9.1 › api › faq › float16
Float16 | Apache MXNet
It has a dynamic range where the precision can go from 0.0000000596046 (highest, for values closest to 0) to 32 (lowest, for values in the range 32768-65536). Despite the inherent reduced precision when compared to single precision float (float32), using float16 has many advantages.
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › find maximum float value in python
Find Maximum Float Value in Python - Spark By {Examples}
May 31, 2024 - How to find the maximum float value in Python? You can find the maximum value of the float data type using the sys.float_info module or the finfo()
Find elsewhere
🌐
Mathematics LibreTexts
math.libretexts.org › bookshelves › scientific computing, simulations, and modeling › scientific computing (staab) › 3: introduction to data types
3.2: Floating Point Numbers - Mathematics LibreTexts
July 20, 2022 - Julia has 16-,32- and 64-bit floating point numbers called Float16, Float32 and Float64 and by default on most systems is the Float64. There are two limitations to any floating-point number. First, the number of digits stored in the number and secondly, the maximum and minimum values.
🌐
Stack Overflow
stackoverflow.com › questions › 3477283 › what-is-the-maximum-float-in-python
floating point - What is the maximum float in Python? - Stack Overflow
The maximum integer in Python 2 is available by calling sys.maxint. ... See also: Maximum and Minimum values for ints.
🌐
Wikipedia
en.wikipedia.org › wiki › Half-precision_floating-point_format
Half-precision floating-point format - Wikipedia
2 weeks ago - Half precision (sometimes called FP16 or float16) is a binary floating-point computer number format that occupies 16 bits (two bytes in modern computers) in computer memory. It is intended for storage of floating-point values in applications where higher precision is not essential, in particular ...
🌐
GeeksforGeeks
geeksforgeeks.org › python-min-max-value-in-float-string-list
Python | Min/Max value in float string list - GeeksforGeeks
April 8, 2023 - The minimum value and maximum value are printed using the variables min_val and max_val respectively. ... # Python3 code to demonstrate working of # Min / Max value in float string list # using numpy import numpy as np # initialize list test_list = ['4.5', '7.8', '9.8', '10.3'] # convert the list of string elements to a numpy array of float elements float_arr = np.array(test_list, dtype=float) # get the minimum and maximum values from the array min_val = np.min(float_arr) max_val = np.max(float_arr) # printing result print("The min value of list : " + str(min_val)) print("The max value of list : " + str(max_val))
🌐
NumPy
numpy.org › doc › stable › user › basics.types.html
Data types — NumPy v2.5 Manual
Unlike NumPy, the size of Python’s int is flexible. This means Python integers may expand to accommodate any integer and will not overflow. NumPy provides numpy.iinfo and numpy.finfo to verify the minimum or maximum values of NumPy integer and floating point values respectively
🌐
W3Resource
w3resource.com › python-interview › what-is-the-maximum-and-minimum-value-for-an-int-float-and-string-data-type-in-python.php
Exploring data type limits in Python
August 12, 2023 - On most platforms, the minimum positive nonzero value is approximately 2.2250738585072014e-308, and the maximum value is approximately 1.7976931348623157e+308. Python's float data type has 15-17 decimal digits of precision.
🌐
SciPy
docs.scipy.org › doc › numpy-1.13.0 › reference › generated › numpy.iinfo.html
numpy.iinfo — NumPy v1.13 Manual
>>> ii16 = np.iinfo(np.int16) >>> ii16.min -32768 >>> ii16.max 32767 >>> ii32 = np.iinfo(np.int32) >>> ii32.min -2147483648 >>> ii32.max 2147483647