redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

math round function



 
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
Trendi



Joined: 25 Jun 2006
Posts: 16
Heh. how do I use Math.round() ?
Java keeps giving me the error: DoubleTester.java:8: possible loss of precision
Yeah ... if I had the api page, I could figure it out ...
  Reply with quote


andergam



Joined: 23 Jun 2006
Posts: 4
Maybe you use float
  Reply with quote
Trendi



Joined: 25 Jun 2006
Posts: 16
andergam, I'm converting a double to int, like so: int percentage = Math.round((100 * probability));
  Reply with quote
andergam



Joined: 23 Jun 2006
Posts: 4
Put (int) before round
  Reply with quote
Trendi



Joined: 25 Jun 2006
Posts: 16
So (int) Math.round(expression); ?
  Reply with quote
andergam



Joined: 23 Jun 2006
Posts: 4
Yes
  Reply with quote
Trendi



Joined: 25 Jun 2006
Posts: 16
K. thank you.
  Reply with quote
andergam



Joined: 23 Jun 2006
Posts: 4
Np
  Reply with quote
Page 1 of 1
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group