Change the comparison method for doubles.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
0b879d044e
commit
92efb3da51
@ -301,7 +301,11 @@ public abstract class Reader{
|
||||
}
|
||||
}
|
||||
}
|
||||
return Double.parseDouble(Integer.toString(numb)+"."+Integer.toString(decimal));
|
||||
try {
|
||||
return Double.parseDouble(Integer.toString(numb)+"."+Integer.toString(decimal));
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int convertToInt(String[]data){return convertToInt("",data);}
|
||||
@ -438,7 +442,7 @@ public abstract class Reader{
|
||||
if (this.other.length()>0 && other.other.length()>0 && !this.other.equals(other.other)) {
|
||||
return false;
|
||||
}
|
||||
if (Double.doubleToLongBits(pct) != Double.doubleToLongBits(other.pct)) {
|
||||
if (Double.compare(pct,other.pct)!=0) {
|
||||
System.out.println("Doubles don't match!");
|
||||
return false;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class sigPlace {
|
||||
Reader lastReader = null;
|
||||
Reader lastSubmittedReader = null;
|
||||
int matches=0;
|
||||
final int EXPECTED_MATCHES=7;
|
||||
final int EXPECTED_MATCHES=5;
|
||||
boolean submitted=false;
|
||||
while (true) {
|
||||
BufferedImage screenshot = r.createScreenCapture(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());
|
||||
|
Loading…
x
Reference in New Issue
Block a user