Unformatted text preview: 1 . 0) and returns the fractional binary representation of that number. Look in Section 2.1 of the book for guidance. You may ﬁnd the MATLAB functions num2str and ﬂoor helpful, as well as the built in documentation regarding strings and the concatenation of strings. The following test cases illustrate the intended behavior of ﬂoat2bin in a MATLAB session. >> float2bin(0.0) ans = 0. >> float2bin(0.5) ans = 0.1 >> float2bin(0.125) ans = 0.001 >> float2bin(0.1) ans = 0.0001100110011001100110011001100110011001100110011001101 >> float2bin(0.123) ans = 0.0001111101111100111011011001000101101000011100101011 1...
View Full Document
- Fall '05
- Numerical Analysis, Alternating Series Theorem, fractional binary representation