mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8191306: Math.abs corner case with optimistic typing
Reviewed-by: jlaskey, hannesw
This commit is contained in:
parent
616491477f
commit
f441abcff1
3 changed files with 36 additions and 2 deletions
|
@ -105,8 +105,8 @@ public final class NativeMath extends ScriptObject {
|
|||
* @return abs of argument
|
||||
*/
|
||||
@SpecializedFunction
|
||||
public static int abs(final Object self, final int x) {
|
||||
return Math.abs(x);
|
||||
public static double abs(final Object self, final int x) {
|
||||
return x == Integer.MIN_VALUE? Math.abs((double)x) : Math.abs(x);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue