how to increse no digits after decimal point?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
rajesh kumar
le 1 Sep 2018
Modifié(e) : Stephen23
le 4 Sep 2018
in matlab coding i am getting ans =0.0012 i want to getting ans =0.001234903423 what to do please suggest me
1 commentaire
Réponse acceptée
KALYAN ACHARJYA
le 1 Sep 2018
Modifié(e) : KALYAN ACHARJYA
le 1 Sep 2018
fprintf('%.12f', ans) %Upto 12 floating points, you can change the value range
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194762/image.png)
3 commentaires
Stephen23
le 4 Sep 2018
Modifié(e) : Stephen23
le 4 Sep 2018
"Upto 12 floating points"
Why 12? Where does this limit come from? I don't see this limit mentioned anywhere in the fprintf help, nor is it related to the precisions of either double or single floating point numbers:
When I try 15 decimal digits, it works just fine:
>> X = 0.123456789012345;
>> fprintf('%.15f\n',X)
0.123456789012345
Where did you get this "Upto 12 floating points" limit from?
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing 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!