You Are Here:

Community: Developer Discussion Boards

#1 Old math s problem - 2008-10-04, 17:23

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Code:
a=15/100
print a
then it write 0
i wanna write 0.15
how can i do it
Reply With Quote

#2 Old Re: math s problem - 2008-10-04, 17:24

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Code:
>>> from __future__ import division
>>> a=15/100
>>> print a
0.15
Reply With Quote

#3 Old Re: math s problem - 2008-10-04, 17:27

Join Date: Aug 2008
Posts: 148
cool_eagle
Offline
Regular Contributor
Quote:
Originally Posted by bogdan.galiceanu View Post
Code:
>>> from __future__ import division
>>> a=15/100
>>> print a
0.15
thanks
Reply With Quote

#4 Old Re: math s problem - 2008-10-04, 23:27

Join Date: Feb 2006
Posts: 168
Location: Helsinki, Finland
RICH?
Offline
Regular Contributor
it will also work without the import with:

15/100.0



Nokia E66
PyS60 1.4.4 final
Reply With Quote

#5 Old Re: math s problem - 2008-10-05, 05:54

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by RICH? View Post
it will also work without the import with:

15/100.0

hi
ya RICH is correct you can do that without importing also by initializing any one of the quantity to a folating point quantity.

Regards
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with eglSwapBuffers and heap corruption greatape Symbian Media (Graphics & Sounds) 2 2007-05-24 04:35
netcards - Problem with opening adapter kernj Symbian Tools & SDKs 5 2007-01-10 09:56
WAP service problem on Apache bigg_o Browsing and Mark-ups 3 2005-04-17 17:05
Problem: S60 SDK for CW in PC with .NET anttij Carbide.c++ IDE and plug-ins 1 2005-02-28 12:36
wireless problem sash_mca General Browsing 0 2003-06-06 12:34

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia