Files
openide/java/java-impl/resources/inspectionDescriptions/MathRoundingWithIntArgument.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

20 lines
753 B
HTML

<html>
<body>
Reports calls to <code>round()</code>, <code>ceil()</code>,
<code>floor()</code>, <code>rint()</code> methods for <code>Math</code> and <code>StrictMath</code> with <code>int</code> as the argument.
<p>These methods could be called in case the argument is expected to be <code>long</code> or <code>double</code>, and it may have unexpected results.</p>
<p>The inspection provides a fix that simplify such expressions (except <code>round</code>) to cast to <code>double</code>.</p>
<p><b>Example:</b></p>
<pre><code>
int i = 2;
double d1 = Math.floor(i);
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
int i = 2;
double d1 = i;
</code></pre>
<!-- tooltip end -->
<p><small>New in 2023.1</small></p>
</body>
</html>