de2bi not working for large decimal number

4 views (last 30 days)
I have a problem with de2bi. Just typing de2bi(bi2de(ones(1,56))) I should trivially obtain ones(1,56), but I obtain a row of 56 zeros and a one. Why is that?

Accepted Answer

Stephen23
Stephen23 on 16 Oct 2019
Edited: Stephen23 on 16 Oct 2019
"Why is that?"
Because those functions use double class, and your value is well above flintmax:
>> 2^53 % flintmax
ans = 9.0072e+015
>> bi2de(ones(1,56)) % your value
ans = 7.2058e+016
See also:

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!