jeg fandt selv løsningen. problemet er at ligge 0.01 til, rækken af tal bliver:
t = 0
t = 0.01
t = 0.02
t = 0.03
t = 0.04
t = 0.05
t = 0.060000000000000005
t = 0.07
t = 0.08
t = 0.09
t = 0.09999999999999999
t = 0.10999999999999998
t = 0.11999999999999998
t = 0.12999999999999998
t = 0.13999999999999998
t = 0.15
t = 0.16
t = 0.17
t = 0.18000000000000002
t = 0.19000000000000003
t = 0.20000000000000004
istedet for
t = 0
Hurra
t = 0.01
t = 0.02
t = 0.03
t = 0.04
t = 0.05
t = 0.06
t = 0.07
t = 0.08
t = 0.09
t = 0.1
t = 0.11
t = 0.12
t = 0.13
t = 0.14
t = 0.15
t = 0.16
t = 0.17
t = 0.18
t = 0.19
t = 0.20
så løsningen er at skrive
var T = 21.18;
var step = 0.01;
for(var t=0;t<(6*T);t+=step){
if((t%T) <= 0.001){
document.write('Hurra<br>');
}
}
adam
Køb en zebra - og kald den plet