de2bi not working for large decimal number

5 visualizaciones (últimos 30 días)
MAURIZIO MURATORI
MAURIZIO MURATORI el 16 de Oct. de 2019
Editada: Stephen23 el 16 de Oct. de 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?

Respuesta aceptada

Stephen23
Stephen23 el 16 de Oct. de 2019
Editada: Stephen23 el 16 de Oct. de 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:

Más respuestas (0)

Categorías

Más información sobre Clocks and Timers en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by