“Float64 Python” Code-Antworten

16 Bit schwimmender Punkt Numpy

# to create an x-bit point with numpy, use np.intx
# to create an unsigned x-bit point with numpy, use np.uintx
# examples:
import numpy as np

a = np.int16(10000) # 10000 stored as a 16-bit number (can store numbers from -32768 to 32767)
b = np.uint(10000) # 10000 stored as an unsigned 16-bit number (can store numbers from 0 to 65535)
ryaba_ryaba_

Float64 Python

>>> numpy.float64(5.9975).hex()
'0x1.7fd70a3d70a3dp+2'
>>> (5.9975).hex()
'0x1.7fd70a3d70a3dp+2'

#They are the same number. What differs is their representation; the Python native type uses a "sane" representation, and the NumPy type uses an accurate representation.
Alison Moura

Ähnliche Antworten wie “Float64 Python”

Fragen ähnlich wie “Float64 Python”

Weitere verwandte Antworten zu “Float64 Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen