Help - Search - Members - Calendar
Full Version: Java Compilling Errors
CyberiaPC.com Community > Technical Zone > Programming (Java SE/EE, VB, C#)
FiShMaStEr
the problem occurs in compiling when it reaches a line using the maths system of java.

CODE
choice = (Math.round(Math.random()*100));


this line keeps coming up with the error in compiling saying "possible loss of precision"

ive looked around on the internet for a solution to this, but the most i could find was people saying to change the variable to a floating interger or double. i have tried both of these to no avail as it will get past that line, then freeze on the next line where the variable choice is used again.

any clues?

if more of the code is needed to help just ask.
usr.c
If choice is declared as a long or float then you shouldn't have any problems with the "loss of precision" warning.

What have you got it declared as?
FiShMaStEr
ive managed to get it working now. i had to declare choice as an interger and then it wouldwork within the arrays later on.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.