013
14.10.2003, 18:11 Uhr
Pablo
Supertux (Operator)
|
| C++: |
double V = 8*7.6631; double seitenlaenge = pow(V/7.6631, 1.0/3.0) ;
|
Du hast falsch gecastst und sieht aus, als hätte ich das nicht berücksichtig. 1/3 ist int/int und 1/3 ist gleich 0 und nicht 0.333333333 Also 1.0/3.0 ist double/double = 0.33333333333333
Wenn du double(int/int) machst, und int/int = 0 ==> double(int/int)=0 ==> pow(irgendetwas, 0)=1.
Du könntest auch:
| C++: |
double V = 8*7.6631; double seitenlaenge = pow(V/7.6631, double(1)/double(3)) ;
|
Wenn du 2 bekommst, dann ist das richtig.
@Windalf war mal schneller  -- A! Elbereth Gilthoniel! silivren penna míriel o menel aglar elenath, Gilthoniel, A! Elbereth! Dieser Post wurde am 14.10.2003 um 18:12 Uhr von Pablo Yanez Trujillo editiert. |