Ambigious methods

I don´t know if you are aware of this but it is kind of disturbing if you don´t want to write your own abs() method… anyhow… here is the error message when i tried to use Math.abs() :

Player.java [37:1] reference to Math is ambiguous, both class org.lwjgl.Math in org.lwjgl and class java.lang.Math in java.lang match
this.angle = Math.abs((angle%360));

=/

The lwjgl methods are for use if you don’t want to use the java.lang.Math methods - since these all operate on (and return) doubles. So either don’t import both at the same time, or just scope the call to the Math class you want to use:

angle = java.lang.Math.abs(theValue);

Ah yeah I see :slight_smile:

Would there be any speed advantage replacing some of the math methods with native versions. Or is the benifit outweighed by crossing over jni?

Could we replace this in org.lwjgl.Math?

public static float sin(float theta) {
return (float) java.lang.Math.sin(java.lang.Math.toRadians(theta));
}