{"ok":true,"site":{"host":"sw23.github.io","url":"https://sw23.github.io/fp-conv/","type":"live","desc":"Convert between FP64, FP32, FP16, BF16, TF32, FP8, FP6, FP4, MX and integer formats. See bits, hex and precision loss under all five IEEE 754 rounding modes.","tools":[{"name":"list_formats","kind":"answer","impl":"imperative","description":"List all available floating-point and integer format presets supported by this converter. Returns format keys, names, categories, and parameters (bits, exponent, mantissa, etc.).","title":"List formats","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{},"required":[]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/fp-conv/","pages":["/fp-conv/"]},{"name":"encode_number","kind":"act","impl":"imperative","description":"Encode a decimal number (or special value like Infinity / NaN) into a specified floating-point or integer format. Returns binary, hex, and component breakdown.","title":"Encode number","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"value":{"type":["number","string"],"description":"The value to encode. Accepts a number, hex string (e.g. \"0xFF\"), or keyword (\"infinity\", \"-infinity\", \"nan\")."},"format":{"type":["string","object"],"description":"Format preset key (e.g. \"fp32\", \"int8\") or custom format object. For floating-point: { signBits, exponentBits, mantissaBits, bias?, hasInfinity?, hasNaN?, hasSubnormals? }. For integer: { bits, signed, fractionBits?, symmetric? }."},"roundingMode":{"type":"string","description":"Rounding mode for encoding the value. Options: \"tiesToEven\" (default, IEEE 754), \"tiesToAway\", \"towardZero\", \"towardPositive\", \"towardNegative\".","enum":["tiesToEven","tiesToAway","towardZero","towardPositive","towardNegative"]},"overflowMode":{"type":"string","description":"What an out-of-range magnitude becomes. \"overflow\" produces Infinity (or NaN when the format has no Infinity); \"saturate\" clamps to the largest finite value. Omit to use the per-format default (overflow for formats with Infinity, saturate otherwise). IEEE 754 §7.4 directed rounding still clamps finite overflow regardless of this setting.","enum":["saturate","overflow"]}},"required":["value","format"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/fp-conv/","pages":["/fp-conv/"]},{"name":"decode_bits","kind":"act","impl":"imperative","description":"Decode a binary or hexadecimal bit-pattern into a specified format. Returns the decimal value and full component breakdown.","title":"Decode bits","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"bits":{"type":"string","description":"Bit-pattern as a binary string (e.g. \"0100000001001000\") or hex string with 0x prefix (e.g. \"0x4048\")."},"format":{"type":["string","object"],"description":"Format preset key (e.g. \"fp16\") or custom format object."}},"required":["bits","format"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/fp-conv/","pages":["/fp-conv/"]},{"name":"convert_format","kind":"act","impl":"imperative","description":"Convert a value or bit pattern from one floating-point or integer format to another. Returns full encoding details for both formats and precision loss analysis.","title":"Convert format","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"value":{"type":["number","string"],"description":"The value to convert. Accepts a number, hex string (read as an integer, e.g. \"0xFF\" is 255), or keyword. Exactly one of \"value\" and \"bits\" is required."},"bits":{"type":"string","description":"The source as a bit pattern in the input format, binary (e.g. \"0011110000000000\") or hex with 0x prefix (e.g. \"0x3C00\"), read as decode_bits reads it and converted exactly as given. Use it to convert an exact encoding such as a NaN with a sign and payload. Exactly one of \"value\" and \"bits\" is required."},"inputFormat":{"type":["string","object"],"description":"Source format preset key or custom format object."},"outputFormat":{"type":["string","object"],"description":"Target format preset key or custom format object."},"roundingMode":{"type":"string","description":"Rounding mode for encoding into the output format; the source operand is built with the input format's defaults. Options: \"tiesToEven\" (default, IEEE 754), \"tiesToAway\", \"towardZero\", \"towardPositive\", \"towardNegative\".","enum":["tiesToEven","tiesToAway","towardZero","towardPositive","towardNegative"]},"overflowMode":{"type":"string","description":"What an out-of-range output magnitude becomes; the source operand is built with the input format's defaults. \"overflow\" produces Infinity (or NaN when the format has no Infinity); \"saturate\" clamps to the largest finite value. Omit to use the per-format default. IEEE 754 §7.4 directed rounding still clamps finite overflow regardless.","enum":["saturate","overflow"]},"nanMode":{"type":"string","description":"What a NaN source operand becomes; it has no effect on any other input. \"canonical\" gives the output format's canonical quiet NaN. \"preserve\" keeps the sign and as many high-order payload bits as fit, and quiets the result (IEEE 754-2019 §6.2.3). Default \"canonical\". Only a \"bits\" source has a payload to keep.","enum":["canonical","preserve"]}},"required":["inputFormat","outputFormat"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/fp-conv/","pages":["/fp-conv/"]},{"name":"get_format_info","kind":"answer","impl":"imperative","description":"Get detailed information about a floating-point or integer format, including value range (max/min normal, subnormal), bias, and special value support.","title":"Get format info","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"format":{"type":["string","object"],"description":"Format preset key (e.g. \"bf16\") or custom format object."}},"required":["format"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute","page":"/fp-conv/","pages":["/fp-conv/"]}],"category":"Developer Tools","favicon":"/favicons/sw23.github.io.png","apiSurface":"spec","toolCount":5}}