Increment bug in repeat loops

Jacques Hausser jacques.hausser at unil.ch
Fri Nov 20 19:51:34 EST 2009


Sorry, it was an accident of cut and paste in my demonstraiton. The results are:

0 : 0.100000000000000006
1 : 0.200000000000000011
2 : 0.300000000000000044
3 : 0.400000000000000022
4 : 0.5
5 : 0.599999999999999978
6 : 0.699999999999999956
7 : 0.799999999999999933
8 : 0.899999999999999911
9 : 0.999999999999999889 < 10, so your loop "with i = 0 to 10 step 0.1" will continue for one more step !
10 : 1.099999999999999867
11 : 1.199999999999999956

******************************************
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax: 	++ 41 22 366 19 40
mobile:	++ 41 79 757 05 24
E-Mail:	jacques.hausser at unil.ch
*******************************************




More information about the use-livecode mailing list