hexsingle2num

版本 1.0.0.0 (2.3 KB) 作者: Mark Lubinski
hex2num for single.
4.2K 次下载
更新时间 2005/6/22

查看许可证

hexsingle2num converts a single precision IEEE hexadecimal string to a number.

hexsingle2num is a version of hex2num which works with single precision floats. Currently MATLAB hex2num converts to double precision floats.

HEXSINGLE2NUM(S), where S is a 8 character string containing a hexadecimal number, returns a double type number equal to the IEEE single precision floating point number it represents. Fewer than 8 characters are padded on the right with zeros.

If S is a character array, each row is interpreted as a single precision number (and returned as a double).

NaNs, infinities and denorms are handled correctly.

Example:
hexsingle2num('40490fdb') returns Pi.
hexsingle2num('bf8') returns -1.

引用格式

Mark Lubinski (2024). hexsingle2num (https://www.mathworks.com/matlabcentral/fileexchange/6927-hexsingle2num), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14SP1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Numeric Types 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Fixed bug with underflow (bug found by Matthias Noell).