You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
double pos = 0.; // posizione iniziale (+20 metri dal suolo)
int ch;
int n; // numero spostamenti
const double epsilon = 1e-7;
do {
cout << pos << endl;
// PROBLEMA: lo zero non viene rappresentato in modo preciso;
if ((pos > 1.0-epsilon && pos < 1.0+epsilon)) // PERICOLO: pos potrebbe non essere esattamente a 1. Non usare l'uguaglianza pura, perchè viene fatto un controllo bit per bit tra i numeri.