de2bi not working for large decimal number

5 vues (au cours des 30 derniers jours)
MAURIZIO MURATORI
MAURIZIO MURATORI le 16 Oct 2019
Modifié(e) : Stephen23 le 16 Oct 2019
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?

Réponse acceptée

Stephen23
Stephen23 le 16 Oct 2019
Modifié(e) : Stephen23 le 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:

Plus de réponses (0)

Catégories

En savoir plus sur Clocks and Timers dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by