[IPython-user] %paste and integer division

Peter Butterworth butterw@gmail....
Mon Mar 15 00:27:06 CDT 2010


In [2]: 2/3
Out[2]: 0.66666666666666663

In [3]: print(2/3)
0.666666666667

On Sun, Mar 14, 2010 at 9:30 PM, Brian Granger <ellisonbg@gmail.com> wrote:
> Just to double check, what do the following give (leaving autocall on):
>
> 2/3
>
> then:
>
> print(2/3)
>
> Brian
>
> On Sun, Mar 14, 2010 at 12:34 PM,  <butterw@gmail.com> wrote:
>> I'm configured to get rid of the old integer division, but %paste doesn't
>> take this into account, which is a pain.
>>
>> ipy_user_conf.py :
>> # for sane integer division that converts to float (1/2 == 0.5)
>> o.autoexec.append('from __future__ import division')
>>
>> Turning autocall off doesn't make any difference here. Not that I would want
>> to turn autocall off.
>
>
>
> --
> Brian E. Granger, Ph.D.
> Assistant Professor of Physics
> Cal Poly State University, San Luis Obispo
> bgranger@calpoly.edu
> ellisonbg@gmail.com
>



-- 
thanks,
peter butterworth


More information about the IPython-user mailing list