IEEE 754 Float Converter
embedcalc_ieee754_convertConvert decimal, hex, or binary to IEEE 754 single or double precision. Get sign, exponent, fraction breakdown and classification (normal, subnormal, zero, infinity, NaN).
Instructions
Encode/decode IEEE 754 single (32-bit) or double (64-bit) precision: decimal <-> hex <-> binary, with sign/exponent/fraction breakdown and classification.
Args:
format (32|64, default 32).
Provide exactly one of: decimal (number), hex (string like '0x3F800000'), bin (bit string).
Returns (structured): { sign, exponent_raw, exponent_unbiased, fraction, hex, bin, decimal (string — may be 'NaN'/'Infinity'), class ('normal'|'subnormal'|'zero'|'infinity'|'nan') }. Examples: 1.0 float -> 0x3F800000; 0.1 double -> 0x3FB999999999999A (not exact!). Do not eyeball float bit patterns — call this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bin | No | Binary bit pattern to decode (32 or 64 chars, spaces allowed) | |
| hex | No | Hex bit pattern to decode, e.g. '0x3F800000' | |
| format | No | 32 = float, 64 = double | |
| decimal | No | Decimal value to encode (one of decimal/hex/bin) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bin | Yes | ||
| hex | Yes | ||
| sign | Yes | ||
| class | Yes | ||
| decimal | Yes | Decimal value as string (may be 'NaN', 'Infinity', '-Infinity') | |
| fraction | Yes | ||
| exponent_raw | Yes | ||
| exponent_unbiased | Yes | exponent - bias; null for zero/subnormal/special |