Heyo all,
Having a problem which seems really stupid but I just cant solve it.
Im reading in a number of integers from a file e.g. 179, 23, 56
I then have to divde them by 255, but when I do I only ever get values of 0 or 1 rather than something like 0.56, 0.79. I thought I could just convert the number to a float before dividing it e.g a = 179 therefore float(a), but that doesnt seem to work, and Ive looked about on the web but cant find an answer.
Any help would be most appreciated thanks!
Mel
Having a problem which seems really stupid but I just cant solve it.
Im reading in a number of integers from a file e.g. 179, 23, 56
I then have to divde them by 255, but when I do I only ever get values of 0 or 1 rather than something like 0.56, 0.79. I thought I could just convert the number to a float before dividing it e.g a = 179 therefore float(a), but that doesnt seem to work, and Ive looked about on the web but cant find an answer.
Any help would be most appreciated thanks!
Mel
Comment