Code covered by the BSD License  

Highlights from
IEEE 754 binary representation

5.0

5.0 | 2 ratings Rate this file 22 Downloads (last 30 days) File Size: 1.65 KB File ID: #25326

IEEE 754 binary representation

by Toby Driscoll

 

15 Sep 2009

Converts a double into its underlying 64-bit representation, including sign, exponent, and mantissa.

| Watch this File

File Information
Description

[S,E,F] = IEEE754(X) returns the sign bit, exponent, and mantissa of an IEEE 754 floating point value X, expressed as binary digit strings of length 1, 11, and 52, respectively.

X is equal to (in exact arithmetic and decimal notation)

      (-1)^S * (1 + F/(2^52)) * 2^(E-1023),

except for special values 0, Inf, NaN, and denormalized numbers (between 0 and REALMIN).

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
05 May 2011 Francisco Camacho Gonzalez  
19 Jun 2011 Paul

A request: could you add single conversion as well!?

30 Jun 2011 Derek O'Connor

Excellent. Very useful when teaching students about floating point arithmetic.

Derek O'Connor

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
ieee double precision binary Toby Driscoll 15 Sep 2009 16:58:08
ieee double precision binary Francisco Camacho Gonzalez 05 May 2011 10:26:36
ieee double precision binary Manuel 10 Jan 2012 04:15:46

Contact us at files@mathworks.com