view test/math.k @ 0:536b29f11352

add some files
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Sat, 28 Apr 2012 21:01:53 +0900
parents
children 44e3247ed7c1
line wrap: on
line source

using konoha.math.*;

void main(String[] args) {
	int x, y;
	if (args.size > 2 ) {
		x = (int)args[0];
		y = (int)args[1];
	} else if (args.size == 1) {
		x = (int)args[0];
		y = 45;
	} else {
		x = 45;
		y = 45;
	}
	int e,d;
	e = 10;
	d = 3;

	print "x = " + x;
	print "y = " + y;
	print "e = " + e;
	print "d = " + d;

	print "Math.abs(x) = " + Math.abs(x);
	print "Math.fabs(x) = " + Math.fabs(x);
	print "Math.pow(x,y) = " + Math.pow(x,y);
	print "Math.ldexp( x, e) = " + Math.ldexp( x, e);
	print "Math.modf( x, y) = " + Math.modf( x, y);
	print "Math.frexp( x, y) = " + Math.frexp( x, y);
	print "Math.fmod( x, d) = " + Math.fmod( x, d);
	print "Math.ceil( x) = " + Math.ceil( x);
	print "Math.floor(x) = " + Math.floor(x);
	print "Math.sqrt(x) = " + Math.sqrt(x);
	print "Math.exp(x) = " + Math.exp(x);
	print "Math.log10(x) = " + Math.log10(x);
	print "Math.log(x) = " + Math.log(x);
	print "Math.sin(x) = " + Math.sin(x);
	print "Math.cos(x) = " + Math.cos(x);
	print "Math.tan(x) = " + Math.tan(x);
	print "Math.asin(x) = " + Math.asin(x);
	print "Math.acos(x) = " + Math.acos(x);
	print "Math.atan(x) = " + Math.atan(x);
	print "Math.atan2(x, y) = " + Math.atan2(x, y);
	print "Math.sinh(x) = " + Math.sinh(x);
	print "Math.cosh(x) = " + Math.cosh(x);
	print "Math.tanh(x) = " + Math.tanh(x);
	
	 
}