please format code with </> button * homework policy * asking questions
Ok, so I’m writing an image editing program and would like to get the aspect ratio of the image. So I declared a float variable called “aspectRatio” and as soon as the user uploads an image, it is put to picture.width/picture.height. If I now let my program print (picture.width + picture.height + aspectRatio), I for example get: 1515 700 2.0, even though the aspect ratio should be something like 2.164285714. It doesn’t matter what image I put in, I always get an even number. Is there a way I can get the real float number? (sorry if my english is bad :))