mirror of
https://bitbucket.org/Mattrixwv/javaclasses.git
synced 2025-12-07 07:23:57 -05:00
Fix sonarqube findings
This commit is contained in:
@@ -51,7 +51,7 @@ public class TriangularNumberGenerator implements Iterator<Long>{
|
||||
}
|
||||
|
||||
public static boolean isTriangular(Long x){
|
||||
Long n = Math.round((Math.sqrt(1 + (8 * x)) - 1) / 2);
|
||||
Long n = Math.round((Math.sqrt(1.0 + (8 * x)) - 1) / 2);
|
||||
return (((n * n) + n) / 2) == x;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user