1.1 - int32(1) = 0 ?
Afficher commentaires plus anciens
The calculation: 1.1 - int32(1) results in 0. Some experimentation tells me that: 1.1 - double(int32(1)) results in the expected 0.1
I would have expected the combination of a double and an int32 to result in a double. Instead it appears to be an int32. Is this the defined behavior? Can anyone point me to a document showing data type precedence in Matlab.
Thanks
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 30 Juil 2013
0 votes
http://www.mathworks.com/help/matlab/numeric-types.html when the operation is possible between two classes, I think the priority is for the class the less precise.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!