나의 연구/GraADS2009. 12. 29. 13:44
ga-> script_math_demo.gs
 
Formatting numbers:
%-6.1f of 3.1456 = 3.1  
%-6.2f of 3.1456 = 3.15 
%6.2f  of 3.1456 =   3.15
%06.3f of 3.1456 = 03.146
%6.0g  of 3.1456 =      3
%12.3e of 3.1456 =    3.146e+00
 
Trigonometric functions:
cos of 45 = 0.7071
sin of 45 = 0.7071
tan of 45 = 1.0000
acos of 0.7071 = 45.0000
asin of 0.7071 = 45.0000
atan of 1.0000 = 45.0000
atan2 of (1,-1) = 135.0000
cosh of 30 = 1.1402
sinh of 30 = 0.5479
tanh of 30 = 0.4805
acosh of 1.1402 = 65.3308 <-- math_acosh() may have a bug ... this value should be 30
asinh of 0.5479 = 30.0000
atanh of 0.4805 = 30.0000
 
Evaluating strings to see if they are numbers:
0 = not a number
1 = integer
2 = not an integer
valnum of 3.1455 = 2
valnum of 3 = 1
valnum of 3e10 = 2
valnum of 390210 = 1
valnum of a string = 0
 
Real-to-integer conversion:
nint of 3.0 = 3    int of 3.0 = 3
nint of 3.1 = 3    int of 3.1 = 3
nint of 3.2 = 3    int of 3.2 = 3
nint of 3.3 = 3    int of 3.3 = 3
nint of 3.4 = 3    int of 3.4 = 3
nint of 3.5 = 4    int of 3.5 = 3
nint of 3.6 = 4    int of 3.6 = 3
nint of 3.7 = 4    int of 3.7 = 3
nint of 3.8 = 4    int of 3.8 = 3
nint of 3.9 = 4    int of 3.9 = 3
 
Exponents:
2 raised to the power 0.5 = 1.4142135623731
 
Exponential function:
exp(1) = 2.71828182845905
 
Natural logarithm:
log(2.71828) = 0.999999327347282
 
Base 10 logarithm:
log10(2) = 0.301029995663981
10 raised to the power 0.3103 = 2.0000000199681
 
Modulo operator fmod:
6 fmod 2.25 (the remainder when 6 is divided by 2.25) = 1.5
 
Modulo operator mod:
6 mod 2.25 (the integer part of the remainder when 6 is divided by 2.25) = 1
 
String operations:
length of the string "this is a test" = 14
word 2 of the string "this is a test" starts at character 6

'나의 연구 > GraADS' 카테고리의 다른 글

trend 분석  (0) 2010.02.10
draw string (math_mod)  (0) 2009.12.30
script_math_demo.gs  (5) 2009.12.29
Standard Deviation  (1) 2009.12.29
draw string  (0) 2009.12.29
Posted by mclab