Dependent Origination

how to force a division in Python

Posted on: March 4, 2011

1. a/float(b)

2. from __future__ import division

c = a/b

3. python 3.x, / is division while // is the old integer division

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

March 2011
M T W T F S S
« Feb   Apr »
 123456
78910111213
14151617181920
21222324252627
28293031  

Twitter

Flickr Photos

%d bloggers like this: