Convertitore IEEE 754 float32 e float64

Ispeziona bit float32/float64, hex e il decimale esatto memorizzato.

Ti è stato utile?
Condividi strumento

0.1 in binary32 è 3DCCCCCD. Il decimale esatto memorizzato è 0.100000001490116119384765625, non 0.1. DataView, campi colorati, clic per invertire un bit.

Il periodo 0.0(0011): decimale a binario. Basi intere: convertitore binario.

float64 di 0.1 = 3FB999999999999A. 5.75 è esatto. −2 accende il bit di segno. ±0, ±∞, NaN, subnormale 1.401298464324817e-45 (00000001).

Come ispezionare i bit IEEE 754

  1. Scrivi un decimale (0.1, 5.75, −2, Infinity, NaN) o hex (3DCCCCCD).
  2. Scegli 32 o 64 bit. Leggi campi, hex, decimale esatto ed errore di arrotondamento.
  3. Clicca un bit per invertirlo. I colori restano.
  4. Confronta ±0, infiniti, NaN, subnormali. Copia hex o bit.

Caratteristiche principali

  • Decimale ↔ float32/64 bit e hex (DataView)
  • Clic sui bit, campi colorati
  • Decimale esatto (BigInt) ed errore
  • ±0, ±∞, NaN, subnormale 00000001
  • Locale, senza upload

Campi ed esempio 0.1

  • binary32: 1+8+23, bias 127. binary64: 1+11+52, bias 1023.
  • 0.1 float32 = 3DCCCCCD, esatto 0.100000001490116119384765625.
  • 5.75 = 101.11. −2 non è complemento a due intero.
  • Il bit meno di +0 dà il più piccolo subnormale float32.

Errori comuni

  • Chiamare 3DCCCCCD «esattamente 0.1».
  • Mescolare complemento a due intero e campi IEEE.
  • Incollare 8 cifre hex in modalità 64 bit.
  • Credere che NaN abbia una sola codifica.

Intervalli interi e float

  • int8…int64 e min/max finiti di float32/64.
TipoMinMax
int8-128127
uint80255
int16-3276832767
uint16065535
int32-21474836482147483647
uint3204294967295
int64-92233720368547758089223372036854775807
uint64018446744073709551615
float32-340282346638528859811704183484516925440340282346638528859811704183484516925440
float64-1.7976931348623157e+3081.7976931348623157e+308

Domande frequenti

0.1 in binary32?

Hex 3DCCCCCD. Esatto 0.100000001490116119384765625.

0.1 in binary64?

Hex 3FB999999999999A. È il Number JS.

Il più piccolo float32 positivo?

Subnormale 1.401298464324817e-45, hex 00000001.

∞ e NaN?

Esponente tutto 1. Mantissa 0 = ±∞; altrimenti NaN.

−0 è diverso da +0?

Nei bit sì: float32 −0 = 80000000.

Perché 5.75 è esatto?

23/4 è diadico. 1/10 no.

Guida pratica a Convertitore IEEE 754

Vedi il blog
Why 0.1 Cannot Be Stored Exactly in Binary

Why 0.1 Cannot Be Stored Exactly in Binary

0.1 is 0.0(0011) repeating in binary. Why IEEE floats round it, and how FlashKit shows the repeating expansion.

Leggi la guida

Categories

Sfoglia tutti gli strumenti FlashKit