A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/307207.html below:

round function problem

round function problemmg mg.mailing-list at laposte.net
Tue Sep 6 03:27:48 EDT 2005
Hi everybody...

We try to white scripts with Pyrhon 2.4 for an acoustic simulation and 
we wrote these follow lines :

<begin script>
c = 340
i =j=k= 1
sum_ = 23
table = []
freq = round((c/2*(sum_)**0.5),2)
print freq
table.append([freq,(i,j,k)])
print i,j,k,' freq',freq
for item in table: print item
<end script>

The problem is simple. The function 'round' allow to obtain the value 
with the specified number of digits after the ",". Then, when the 
variable 'freq' is printed, there is no problem; but when freq is set in 
the table and the table printed, all the digits are come back.

Is it a bug or a control behavour ? I don't understand ?!?!?!?!...

Thanks

Mathieu



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4