On Thu, Mar 17, 2011 at 10:57 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > On Thu, Mar 17, 2011 at 10:46 AM, kracekumar ramaraju > <kracethekingma...@gmail.com> wrote: >> I tried the following >>>>> 22/7.0 >> 3.1428571428571428 >>>>> import math >>>>> math.pi >> 3.1415926535897931 >>>>> >> >> >> Why is the difference is so much ?is pi =22/7 or something ? > > Pi is not 22/7. That is just a commonly-used approximation.
I should add that math.pi is also not pi, because pi cannot be exactly represented as a floating-point number. It is another approximation that has several more digits of precision than 22/7. -- http://mail.python.org/mailman/listinfo/python-list