from double to single precision

52 vues (au cours des 30 derniers jours)
Beaya
Beaya le 27 Oct 2013
Commenté : Azzi Abdelmalek le 27 Oct 2013
I want to calcute this equation x= 3.0*(4.0/3.0-1.0)-1.0 but using single precision instead of double. How do I do switch to single?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 27 Oct 2013
  3 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 27 Oct 2013
x = 1 - 3*(4/3 - 1)
a=single(x)
whos x a
and see the difference
Azzi Abdelmalek
Azzi Abdelmalek le 27 Oct 2013
To get the smallest double and single number
realmin('double')
realmin('single')

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by