Skip to content

Repository files navigation

macOS Linux Windows

fpshow

Convert/inspect the IEEE 754 bit representation of a floating-point number.

Usage

Usage: fpshow [--f32|--f64|--raw32|--raw64] <value>

Inspect the IEEE 754 bit representation of a floating-point value.

Modes:
  --f32    Parse <value> as a 32-bit float  (default)
  --f64    Parse <value> as a 64-bit double
  --raw32  Interpret <value> as a raw 32-bit hex/integer bit pattern
  --raw64  Interpret <value> as a raw 64-bit hex/integer bit pattern

Arguments:
  <value>  Numeric value to inspect. For --raw32/--raw64, hex (0x...)
           and decimal integers are accepted.

Output:
  Sign, exponent, and fraction fields with their numeric values.
  Decoded value in mathematical form (handles ±0, ±inf, NaN, subnormals).
  Plain decimal and hex-float representations.
  Raw bit pattern with [sign][exponent][fraction] layout.
  ARMv8-A+ 8-bit immediate encoding eligibility and operand byte.
           e.g.: fmov s0, 1.125

Examples:
  fpshow 1.0
  fpshow --f32 -2.5
  fpshow --f64 3.141592653589793
  fpshow --raw32 0x3f800000
  fpshow --raw64 0x400921fb54442d18

License

MIT License

Acknowledgements

@memphis242 for code review & valuable suggestions.

Feedback

Bugs/Suggestions/Comments/Feedback to: Email: feedback@THLG.NL

About

IEEE 754 floating point command line visualizer/converter

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages