from double to single precision

146 visualizzazioni (ultimi 30 giorni)
Beaya
Beaya il 27 Ott 2013
Commentato: Azzi Abdelmalek il 27 Ott 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?

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Particle & Nuclear Physics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by