builtins.c (java_builtins): Add acos, asin, ceil and floor.
* builtins.c (java_builtins): Add acos, asin, ceil and floor. (initialize_builtins): Likewise, define acos, asin, ceil and floor. * testsuite/libjava.lang/MathBuiltin.java: Add tests for acos, asin, ceil and floor. From-SVN: r81341
This commit is contained in:
parent
2d84a437b0
commit
2d99c042fc
4 changed files with 45 additions and 2 deletions
|
@ -5,6 +5,16 @@ class MathBuiltin
|
|||
return Math.abs(x);
|
||||
}
|
||||
|
||||
static double acos(double x)
|
||||
{
|
||||
return Math.acos(x);
|
||||
}
|
||||
|
||||
static double asin(double x)
|
||||
{
|
||||
return Math.asin(x);
|
||||
}
|
||||
|
||||
static double atan(double x)
|
||||
{
|
||||
return Math.atan(x);
|
||||
|
@ -15,6 +25,11 @@ class MathBuiltin
|
|||
return Math.atan2(x,y);
|
||||
}
|
||||
|
||||
static double ceil(double x)
|
||||
{
|
||||
return Math.ceil(x);
|
||||
}
|
||||
|
||||
static double cos(double x)
|
||||
{
|
||||
return Math.cos(x);
|
||||
|
@ -25,6 +40,11 @@ class MathBuiltin
|
|||
return Math.exp(x);
|
||||
}
|
||||
|
||||
static double floor(double x)
|
||||
{
|
||||
return Math.floor(x);
|
||||
}
|
||||
|
||||
static double log(double x)
|
||||
{
|
||||
return Math.log(x);
|
||||
|
@ -62,8 +82,9 @@ class MathBuiltin
|
|||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
double sum = abs (1.0) + atan (1.0) + atan2 (1.0, 1.0) + cos (1.0)
|
||||
+ exp (1.0) + log(1.0) + max(1.0, 1.0) + min (1.0, 1.0)
|
||||
double sum = abs (1.0) + acos (1.0) + asin (1.0) + atan (1.0)
|
||||
+ atan2 (1.0, 1.0) + ceil (1.0) + cos (1.0) + exp (1.0)
|
||||
+ floor (1.0) + log(1.0) + max(1.0, 1.0) + min (1.0, 1.0)
|
||||
+ pow (1.0, 1.0) + sin (1.0) + sqrt(1.0) + tan(1.0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue