Fun with numbers - dammit, but I want a cast!

Charl P. Botha cpbotha at i_triple_e.org
Mon Aug 11 08:47:38 EDT 2003


In article <3f378fac$0$10778$afc38c87 at auth.uk.news.easynet.net>, 
Graham Nicholls wrote:
> then I'm trying to  use those sizes to scale the image, but because python
> has decided that they are integers, I keep getting division by zero errors
> 
> eg      
>         xscale=xframe/img_x
> 
> where xframe will be say 300, and img_x will be 1800
> xscale has the value 0.

Have you tried doing it this way:
xscale = xframe / float(img_x)

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/




More information about the Python-list mailing list