mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8302027: Port fdlibm trig functions (sin, cos, tan) to Java
Reviewed-by: bpb
This commit is contained in:
parent
9fdbf3cfc4
commit
1bb39a95eb
7 changed files with 2293 additions and 22 deletions
|
@ -127,7 +127,9 @@ public final class StrictMath {
|
|||
* @param a an angle, in radians.
|
||||
* @return the sine of the argument.
|
||||
*/
|
||||
public static native double sin(double a);
|
||||
public static double sin(double a) {
|
||||
return FdLibm.Sin.compute(a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the trigonometric cosine of an angle. Special cases:
|
||||
|
@ -139,7 +141,9 @@ public final class StrictMath {
|
|||
* @param a an angle, in radians.
|
||||
* @return the cosine of the argument.
|
||||
*/
|
||||
public static native double cos(double a);
|
||||
public static double cos(double a) {
|
||||
return FdLibm.Cos.compute(a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the trigonometric tangent of an angle. Special cases:
|
||||
|
@ -151,7 +155,9 @@ public final class StrictMath {
|
|||
* @param a an angle, in radians.
|
||||
* @return the tangent of the argument.
|
||||
*/
|
||||
public static native double tan(double a);
|
||||
public static double tan(double a) {
|
||||
return FdLibm.Tan.compute(a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the arc sine of a value; the returned angle is in the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue