Hi Arulanan,
    Try this link http://docs.python.org/tutorial/floatingpoint.html
<http://docs.python.org/tutorial/floatingpoint.html>

On Tue, Aug 24, 2010 at 4:04 PM, Arulalan T <[email protected]> wrote:

> Dear All,
>
> I need one help.
>
> In python, I need to set the floating point precision as 2.
>
> I am getting the following output in python while adding two float nos.
>
> >>>a=79.73
> >>>b=0.5
> >>> a+b
> 80.230000000000004
>
> I need exactly 2 precision point in this float value. i.e. 80.23
>
> Even though I tried in round method, its not satisfied me. Because
>
> >>> a = round(3.7138464897123424324355124355,2)
> >>> a
> 3.71
> >>> a = round(3.7238464897123424324355124355,2)
> >>> a
> 3.7200000000000002
>
> Can you understand the difference. Depends upon the value, it will round.
>
> I no need ceil and floor options. Because it may change the original
> values.
>
> I need just 2 precision point in the float value.
>
> I am getting two numbers dynamically. So I can not say exactly, what kind
> of
> floating numbers I am going to use.
>
> What I have to do ?
>
> Any suggestions ?
>
> Thanks in advance.
>
>
>
>
>
>
> --
> Regards,
> Arulalan.T
>
> Kanchi Linux User Group Rocks !
> http://kanchilug.wordpress.com
>
> My Experiments In Linux are here
> http://tuxcoder.wordpress.com
> _______________________________________________
> ILUGC Mailing List:
> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
>



-- 
Cheers,
Ranjith Kumar.K,
Software Engineer,
Sedin Technologies,

http://ranjithtenz.wordpress.com/
http://victusads.com/
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to