Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
double step = 0.125;
double zahl = step; // zahl = 0.125
for(int i = 1 ;i<=100;i++)
{
zahl += step;
System.out.println(zahl);
}
// oder auch
double zahl = 0.125*100;
System.out.println(zahl);
Wieso multiplizierst du nicht einfach?
Warum nicht?Vergiss es, wenn du 100 mal 0,125 aufeinander addierst, wirst du sicher nicht 12,5 bekommen, selbst wenn du doubles verwendest.
Sorry das ich so dumm nachfrage ... aber wenn TO schon im Titel sagt das er ADDIEREN will ... wie kommst du dann auf MULTIPLIZIEREN ?
Zu mal selbst mir als Mathe-Phreak nicht wirklich einleuchten will wie du das multiplizieren willst um auf die gewünschten Ergebnisse zu bekommen.