How to increase precision in this case?
Afficher commentaires plus anciens
I have a code which finds the first 10 consecutive numbers after decimal that forms a prime number:
k = 10;
while true
a = mod(floor((pi-3)*10^k),10^10);
if isprime(a) == 1
disp(a)
break
endif
k += 1;
endwhile
And this only works for pi, I also need it to e but its not enough precision
What can i do here?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
