Fix sonarqube findings

This commit is contained in:
2022-08-20 13:54:26 -04:00
parent 8f35397177
commit a845925f99
4 changed files with 4 additions and 5 deletions

View File

@@ -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;
}
}