22

Click here to load reader

Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

  • Upload
    ngonhi

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

[100] 209 revised on 2012.10.28 cemmath

The Simple is the Best

double Scalars are interpreted to be data types of ‘double’ and ‘complex’ in Cemmath. As a matter of fact, all the real numbers are stored as ‘double’ in Cemmath.

//----------------------------------------------------------------------// pre-defined constants//---------------------------------------------------------------------- pi = 3.14159 ... _e = 2.71828 ... // exp(1) _gamma = 0.5772156649015329... // Euler-Mascheroni const inf = 1.e60 // a large number replacing infinity NaN = 1.#IND // not a number

#> pi ; ans = 3.1415927

#> NaN ; // not a number ans = -1.#IND

#> pi = 5 ; // pre-defined constants cannot be changed by assignment line 1 : error #13000: '=' : left operand must be l-value ; pi ??? = 5

//----------------------------------------------------------------------// logical true or false//---------------------------------------------------------------------- A non-zero number is 'true', and the zero is 'false'. A prefix ! is a 'not' operator.

#> !0 ; // not of false = true ans = 1

#> !3 ; // not of true = false ans = 0

//----------------------------------------------------------------------

1

Page 2: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

// unary operation//---------------------------------------------------------------------- |x| // absolute -x // unary minus x! // x*sqrt(-1+0!), pure imaginary number !x // returns 1 if x is zero(0), otherwise returns 0

#> 3! ; // complex number ans = 0 + 3!

#> x = 1.7 ; // nonzero corresponds to 'true' x = 1.7

#> !x ; // not x, false since x = 1.7 is not zero. ans = 0

//----------------------------------------------------------------------// binary operation//---------------------------------------------------------------------- x + y // addition x - y // subtraction x * y // multiplication x / y // right division x \ y // left division, equal to y / x x ^ y // power x % y // remainder, equal to .mod(x,y)

#> 2 + 3; ans = 5

#> 2 - 3; ans = -1

#> 2 * 3; ans = 6

#> 2 / 3; // right division ans = 0.66666667

#> 2 \ 3; // left division ans = 1.5

#> 2 ^ 3; // 2 * 2 * 2 ans = 8

2

Page 3: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

#> 13 % 5; // 13 = 5*2 + 3, remainder is 3 ans = 3

//----------------------------------------------------------------------// compound assignment//---------------------------------------------------------------------- x += y // x = x + y compound addition x -= y // x = x - y compound subtraction x *= y // x = x * y compound multiplication x /= y // x = x / y compound quotient x ^= y // x = x ^ y compound power x %= y // x = x % y compound remainder

//----------------------------------------------------------------------// conditional operations//---------------------------------------------------------------------- x && y // and x || y // or x !& y // exclusive and x !| y // exclusive or

#> 3 && 5 ; 3 && 0 ; 0 && 5; 0 && 0 ; // and ans = 1 ans = 0 ans = 0 ans = 0

#> 3 || 5 ; 3 || 0 ; 0 || 5; 0 || 0 ; // or ans = 1 ans = 1 ans = 1 ans = 0

#> 3 !& 5 ; 3 !& 0 ; 0 !& 5; 0 !& 0 ; // exclusive and ans = 1 ans = 0 ans = 0 ans = 1

#> 3 !| 5 ; 3 !| 0 ; 0 !| 5; 0 !| 0 ; // exclusive or ans = 0 ans = 1 ans = 1 ans = 0

//----------------------------------------------------------------------

3

Page 4: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

// relational operations//---------------------------------------------------------------------- x == y // equality, return (1) if equal, or return (0) x != y // inequality x > y // return (1) if true, or return (0) x < y x >= y x <= y

#> 5 == 6 ; 5 != 6 ; ans = 0 ans = 1

#> 5 < 6; 5 > 6 ; ans = 1 ans = 0

#> 5 <= 6 ; 5 >= 6 ; ans = 1 ans = 0

//----------------------------------------------------------------------// deconvolution//---------------------------------------------------------------------- (q,r) = a /% b ; // a = bq + r (deconvolution for integers)

#> .div(13,5) ; // 13 = 5*2 + 3, quotient is 2 ans = 2

#> .mod(13,5) ; // 13 = 5*2 + 3, remainder is 3 ans = 3

#> (q,r) = 13 /% 5 ; // 13 = 5 * 2 + 3, deconvolution q = 2 r = 3

//----------------------------------------------------------------------// ternary operation//---------------------------------------------------------------------- a ? b : c // If a is true, b is selected. Otherwise c is selected.

#> 3 ? 5 : 7 ; ans = 5

#> 0 ? 5 : 7 ; ans = 7

4

Page 5: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

//----------------------------------------------------------------------// prefix ++, -- //----------------------------------------------------------------------// variable is increased/decreased 'before use'#> a = 1; b = ++a; a = 1 b = 2

#> a; b; // b is equal to the 'new' value of a a = 2 b = 2

//----------------------------------------------------------------------// postfix ++, -- //----------------------------------------------------------------------// variable is increased/decreased 'after use'#> a = 1; b = a++; a = 1 b = 1

#> a; b; // b is equal to the 'old' value of a a = 2 b = 1

//----------------------------------------------------------------------// 'relative difference' operation//---------------------------------------------------------------------- x .-. y // |x-y| / ( 1 + |x|+|y|)

#> x = 1; y = 2; x - y; x.-.y; |x-y|/(1+|x|+|y|); x = 1 y = 2 ans = -1 // x - y ans = 0.25 // x .-. y ans = 0.25 // |x-y|/(1+|x|+|y|)

#> x = 1.23456789e-7; y = 1.2e-7; x - y; x .-. y; // x, y are small x = 1.2345679e-007 y = 1.2e-007 ans = 3.456789e-009 // x - y ans = 3.4567882e-009 // x .-. y

#> x = 1.23456789e+1; y = 1.23456709e+1; x - y; x .-. y; // 7 digits identical

5

Page 6: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

x = 12.345679 y = 12.345671 ans = 8e-006 // x - y ans = 3.1138886e-007 // x .-. y

#> x = 1.23456789e+7; y = 1.23456709e+7; x - y; x .-. y; // x-y=8, 7 digits identical x = 12345679 y = 12345671 ans = 8 // x - y ans = 3.2400009e-007 // x .-. y

//----------------------------------------------------------------------// 'approximate equality'//---------------------------------------------------------------------Any real number x with a limited number of digits cannot be equal to 'pi'. In this regard, an approximate equal operator is introduced to be

x ~= y // x .-. y < eps, i.e. true if |x-y| / ( 1 + |x|+|y|) < eps

where eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if the difference is smaller than eps=1.e-6.

This 'eps' criterion is set by default to be eps=1.e-6, but it can be changed at any time by

#> ~=(1.e-3) ; // newly-specified eps for ~=

A few examples with eps=1.e-6 are

#> x = 1.23456789e-7; y = 1.2e-7; x .-. y; x ~= y; // difference is too small, true ! x = 1.2345679e-007 y = 1.2e-007 ans = 3.4567882e-009 // x .-. y ans = 1 // x ~= y

#> x = 1.23456789e+1; y = 1.23456709e+1; x .-. y; x ~= y; x = 12.345679 y = 12.345671 ans = 3.1138886e-007 // x .-. y ans = 1 // x ~= y

#> x = 1.23456789e+7; y = 1.23456709e+7; x .-. y; x ~= y; // though x-y = 8

6

Page 7: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

x = 12345679 y = 12345671 ans = 3.2400009e-007 // x .-. y ans = 1 // x ~= y

#> x = 10; y = 20; x .-. y; x ~= y; // absolutely false ! x = 10 y = 20 ans = 0.32258065 // x .-. y ans = 0 // x ~= y

//----------------------------------------------------------------------// Number system//----------------------------------------------------------------------x .. p // double x in decimal, p is a base, returns 'string's .. p // string s with base p to decimal system, returns 'double'(s..p)..q // write inside (base p), read outside (base q)

#> 75 .. 2 ; // into the binary system 1001011 [2]

#> "1001011" ..2 ; // into the decimal system (default) ans = 75

#> "A3F"..16 ; // from 16 to 10, hexa to deci ans = 2623

#> 2623 .. 16 ; // from 10 to 16, deci to hexa A3F [16]

#>"3F.4CE"..16 ; ans = 63.30029296875

#> 63.30029296875 ..16 ; 3F.4CE [16]

#> 63.30029296875 ..2 ; 111111.01001100111 [2]

#>("3F.4CE" ..16) ..2 ; // write inside, read outside 111111.01001100111 [2]

//----------------------------------------------------------------------// Priorities of operations for double//----------------------------------------------------------------------

7

Page 8: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

Priorities are listed from the hightest.( ) . ..|x| // absolute!x x! ++x --x x++ x-- &x // prefix, postfix^ // power+x -x // prefix, postfix * / \ % /% // multiplicative

+ - .-. // additive< > <= >= // relational== != ~= // relational&& !& // conditional|| !| // conditional? : // ternary= += -= *= /= ^= %= // assignment , // comma

#> a = 3 ; a = 3

#> -a^2 ; ans = -9

#> b = ++a^2 ; // not recommended, use parenthesis instead b = 16

//----------------------------------------------------------------------// 'double'-returning member functions//----------------------------------------------------------------------x .abs // equal to |x|x .ceil // integer near inf

x .c2f // Celsius to Fahrenheit temperaturex .c2k // Celsius to Kelvin temperaturex .c2r // Celsius to Rankine temperature

x .decimal // deviation from the closest integerx .dfact // double factorial of x, x(x-2)(x-3)...x .fact // factorial of x, x(x-1)(x-2)...x .fix // integer near 0x .floor // integer near -inf

x. f2c // Fahrenheit to Celsius temperaturex .f2k // Fahrenheit to Kelvin temperaturex .f2r // Fahrenheit to Rankine temperature

8

Page 9: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

x .G // .G(x) = (x-1)!, Gamma functionx .H // H(x) =1 for x > 0 and H(x) = 0 for x<=0 x .isprime // (1) if prime number, otherwise (0)

x .k2c // Kelvin to Celsius temperaturex .k2f // Kelvin to Fahrenheit temperaturex .k2r // Kelvin to Rankine temperature

x .pm // (1) if even, and (-1) if odd, cos(n*pi)x .long // additional print with long formatx .ratio(denom=10000) // rational approximation (denom up to 10000)

x .r2c // Rankine to Celsius temperaturex .r2f // Rankine to Fahrenheit temperaturex .r2k // Rankine to Kelvin temperature

x .round // nearest integer to xx .sign // (1) if x>0, (-1) if x<= and (0) if x=0x .todeg // x * 180 / pi, radian to degreex .torad // x * pi / 180, degree to radianx .trun(eps=1.e-30) // truncate if |x|<epsx .trun1,trun2,...,trun16 // truncate with eps=10^-1 ..., 10^-16

#> 5 .fact ; // 5 * 4 * 3 * 2 * 1 ans = 120

#> 5 .dfact ; // 5 * 3 * 1 ans = 15

#> pi.ceil ; (-pi).ceil ; // near +infinity ans = 4 ans = -3

#> pi.floor ; (-pi).floor ; // near -infinity ans = 3 ans = -4

#> pi.fix ; (-pi).fix ; // near 0 ans = 3 ans = -3

#> pi.round ; (-pi).round ; // near x ans = 3 ans = -3

9

Page 10: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

#> pi.decimal ; // x.decimal = x - x.round ans = 0.14159265

#> pi .todeg ; ans = 180

#> 180 .torad ; ans = 3.1415927

#> (0.5).G ; // (0.5).G = (-0.5).fact = sqrt(pi) = 1.7724537... ans = 1.7724537

#> pi.ratio(100) ; // rational approximation with denom < 100 ans = (22/7) - 1.26e-003

#> pi.long ; // print 16-digits value 3.141592653589793 ans = 3.1415927

#> a = 2.e-4; a = 0.0002

#> a.trun3; // zero if |a| < 10^-3 ans = 0

#> a.trun16; // zero if |a| < 10^-16 ans = 0.0002

%> actually .pm(n) = cos(n*pi) to avoid (-1)^n#> (0).pm ; 4.pm ; (-1).pm ; // cos(0*pi), cos(4*pi), cos(-pi) ans = 1 ans = 1 ans = -1

%> application of x.pm = .pm(x)#> sum = 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + 1/7 - 1/8 + 1/9 - 1/10; sum = 0.64563492

#> s = 0; for(n=1; n<=10; n++) s -= n.pm/n ; s = 0 s = 1 s = 0.5 s = 0.83333333 s = 0.58333333 s = 0.78333333 s = 0.61666667

10

Page 11: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

s = 0.75952381 s = 0.63452381 s = 0.74563492 s = 0.64563492

#> sum.ratio; s.ratio; ans = (1627/2520) ans = (1627/2520)

//----------------------------------------------------------------------// 'matrix'-returning member functions//--------------------------------------------------------------------- x .divisor // divisors of an integer x .factor // a matrix with prime numbers factoring a number

#> 360.divisor ; // .divisor(360); ans = [ 1 2 3 4 5 6 8 9 10 12 15 18 20 24 30 36 40 45 60 72 90 120 180 360 ]

#> 360.factor ; // .factor(360); ans = [ 2 2 2 3 3 5 ]

//----------------------------------------------------------------------// temperature conversion//----------------------------------------------------------------------(1) conversion into Kelvin ( c2k, f2k, r2k ) #> 25 .c2k ; ans = 298.15 #> 77 .f2k ; ans = 298.15 #> 540 .r2k ; ans = 300

(2) conversion into Celsius ( k2c, f2c, r2c ) #> 300 .k2c ; ans = 26.85 #> 77 .f2c ; ans = 25 #> 540 .r2c ; ans = 26.85

(3) conversion into Fahrenheit ( k2f, c2f, r2f ) #> 300 .k2f ; ans = 80.33 #> 25 .c2f ; ans = 77 #> 540 .r2f ; ans = 80.33

(4) conversion into Rankine ( k2r, c2r, f2r ) #> 300 .k2r ; ans = 540 #> 25 .c2r ; ans = 536.67 #> 77 .f2r ; ans = 536.67

11

Page 12: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

Other unit-conversion functions are listed in the 'unit' directory.

//----------------------------------------------------------------------// double array//----------------------------------------------------------------------An array of double is defined according to the following syntax

#> double u[7], v[21];

where u and v are the names of arrays. The dimension of an array can be a variable of type 'double'.

#> n=10; double u[n]; n = 10

#> for.i(0,4) u[i] = i*i;;

#> u; u = double [10] [0] = 0 [1] = 1 [2] = 4 [3] = 9 [4] = 16 [5] = 1.7474949e-023 [6] = 1.1590038e+132 [7] = 1.2256212e-100 [8] = 5.3125346e+276 [9] = 1.9178818e-317

Note that an array is not initialized automatically. Therefore, somehow strange values may occur.

//----------------------------------------------------------------------// class function//---------------------------------------------------------------------- A default format string is a null string "" which is equivalent to "%15.8g". The output format can be changed by

double .format(string);

For example, printing format can be changed as follows.

#> double.format("%25.8e"); sqrt(2); ans = 1.41421356e+000

12

Page 13: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

#> double.format("<< %-15.8g >>"); sqrt(2); ans = << 1.4142136 >>

#> double.format(""); sqrt(2); ans = 1.4142136

//-----------------------------------------------------------// Physical constants//-----------------------------------------------------------// Each constant starts with a single '_' (underline)//-----------------------------------------------------------_alpha = 0.0072973525376 // fine-structure const_c0 = 2.99792458 x 10^8 // speed of light [m/s]_eC = 1.602176487 x 10^-19 // elementary charge [C]_eV = 1.7827 x 10^-36 // electron volt [kg]_e0 = 8.854187817 x 10^-12 // electric const [F/m]_F = 96485.33977318 // Faraday const [C/mol]_g = 9.80665 // earth's gravity [m/s^2]_gc = 32.174 // earth's gravity in British unit [ft/s^2]_G = 6.673 x 10^-11 // gravitational const [m^3/(kg.s^2)]_G0 = 7.7480917004 x 10^-5 // conductance quantum [ohm^-1]_h = 6.62606896 x 10^-34 // Planck's const [J.s]_k = 1.3806504 x 10^-23 // Boltzmann const [J/K]_ke = 8.987551787368176 x 10^9 // Coulomb const [N.m^2/C^2]_muB = 9.27400915 // Bohr magneton [J/T], T=tesla_mu0 = 1.2566370614 x 10^-6 // magnetic const [N/A^2]_m_e = 9.10938215 x 10^-31 // electron mass [kg]_m_m = 1.8835313 x 10^-28 // muon mass [kg]_m_n = 1.674927211 x 10^-27 // neutron mass [kg]_m_p = 1.672621637 x 10^-27 // proton mass [kg]_m_t = 3.16777 x 10^-27 // tau mass [kg]_m_u = 1.660538782 x 10^-27 // atomic mass [kg]_NA = 6.02214179 x 10^23 // Avogadro's const [mol^-1]_phi0 = 2.067833667 x 10^-15 // magnetic flux quantum [Wb], _R = 8.31447247122 // molar gass const [J/(mol.K)]_Rinf = 1.0973731568527 x 10^7 // Rydberg const [m^-1]_sigma = 5.6704 x 10^-8 // Stefan-Boltzmann[W/(m^2.K^4)]_Z0 = 376.73031346177 // Impedance of vacuum [ohm]

#> _F - _NA*_eC ; // relation check, _F =_NA*_eCans = -9.167706593871117e-010

//-----------------------------------------------------------// Summary of Unit constants in Cemmath

13

Page 14: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

//-----------------------------------------------------------Unit constants are expressed in reference units,

[kg] [s] [m] [m^2] [m^3] [m/s] [m/s^2][K] [kN] [kJ] [kW] [kPa] [kN.m] [kg/m^3]

The followings are only for named units. Other derived units are calculated by using unit constants. For example,

#> 5 * _oz/_in^3 ; // ounce-mass per cubic inchans = 8649.9452

results in a conversion into [kg/m^3].//-----------------------------------------------------------_A = 10^-10 [m] // Angstrom_acre = 4046.8564224 [m^2] // acre, or _ac_atm = 101.32501 [kPa] // atmosphere_atmtec = 98.0665 [kPa] // atmosphere technical, kgf/cm^2_au = 1.496 x 10^11 [m] // astronomical unit_bar = 100 [kPa] // bar_bbl = 0.159 [m^3] // barrel (petroleum), or_barrel_bhp = 9.810657 [kW] // boiler horse power_BTU = 1.0550559 [kJ] // British Thermal Unit_cal = 0.0041868 [kJ] // calorie_Cal = 4.1868 [kJ] // kilo calorie_cc = 10^6 [m^3] // cubic centimeter, _mL_cm = 0.01 [m] // centimeter_cm2 = 10^-4 [m^2] // square centimeter_cm3 = 10^-6 [m^3] // milliliter or cubic centimeter_cmAq = 0.0980638 [kPa] // cm of water_cmHg = 1.3332237 [kPa] // cm of mercury_cup = 236.588 x 10^-6 [m^3] // cup_Cup = 284.130625 x 10^-6 [m^3] // cup(UK)_c0 = 2.9979246 x 10^8 [m/s] // speed of light_day = 86400 [s] // day_dL = 0.0001 [m^3] // deci-liter_dyne = 10^-8 [kN] // dyne, or _dyn_erg = 10^-10 [kJ] // erg_floz = 29.5735 x 10^-6 [m^3] // fluid oz_Floz = 28.4130625 x 10^-6 [m^3] // ounce(UK)_ft = 0.3048 [m] // feet_ft2 = 0.09290304 [m^2] // square feet_ft3 = 0.028316846592 [m^3] // cubic feet_gal = 0.00378541 [m^3] // gallon_Gal = 0.00454609 [m^3] // gallon (UK)_gill = 118.2941 x 10^-6 [m^3] // gill

14

Page 15: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

_Gill = 142.0653125 x 10^-6 [m^3] // gill(UK)_GJ = 10^6 [kJ] // giga Joule_GN = 10^6 [kN] // giga newton_GPa = 10^6 [kPa] // giga Pascal_gr = 6.479891 x 10^5 [kg] // grain_gram = 0.001 [kg] // gram_GW = 10^6 [kW] // giga Watt_gyr = 31556952 [s] // gregorian year_ha = 10000 [m^2] // hectare_hp = 0.74569987 [kW] // horse power (internat'l)_hPa = 0.1 [kPa] // hecto Pascal_hph = 2684.5195 [kJ] // horsepower-hour, _hp*_hr_hpm = 0.73549875 [kW] // horse power (metric)_hr = 3600 [s] // hour, or _hour_in = 0.0254 [m] // inch_in2 = 6.4516 x 10^-4 [m^2] // square inch_in3 = 16.387064 x 10^-6 [m^3] // cubic inch_inAq = 0.249089 [kPa] // inch of water_inHg = 3.386389 [kPa] // inch of mercury_J = 0.001 [kJ] // Joule_jyr = 31557600 [s] // julian year_kcal = 4.1868 [kJ] // kilo calorie_kg = 1 [kg] // kilogram_kgf = 0.00980665 [kN] // kilogram-force_kip = 4.4482216 [kN] // 1000 * _lbf_kJ = 1 [kJ] // kilo Joule_km = 1000 [m] // kilometer_km2 = 10^6 [m^2] // square kilometer_km3 = 10^9 [m^3] // cubic kilometer_kmph = 0.27777778 [m/s] // kilometer per hour, or _kmphr_kN = 1 [kN] // kilo newton_knot = 0.514444 [m/s] // knot, or_kn_kPa = 1 [kPa] // kilo Pascal_ksi = 6894.7573 [kPa] // 1000 * _psi_ksf = 47.880279 [kPa] // 1000 * _psf_kt = 0.0002052 [kg] // carat, or _carat_kW = 1 [kW] // kilo Watt_kWh = 3600 [kJ] // _kW*_hr_L = 0.001 [m^3] // liter_lb = 0.45359237 [kg] // pound-mass, or _lbm_lbf = 0.0044482216 [kN] // pound-force_ly = 9.4607 x 10^15 [m] // light year_lyr = 31622400 [s] // leap year_m = 1 [m] // meter_m2 = 1 [m^2] // square meter_m3 = 1 [m^3] // cubic meter

15

Page 16: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

_mach = 320 [m/s] // mach, typical value 320 m/s_mb = 0.1 [kPa] // milli bar, or _mbar_mg = 10^-6 [kg] // milligram_mi = 1609.344 [m] // mile_mi2 = 2589988.110336 [m^2] // square mile_mi3 = 4.16818182544058 x 10^9 [m^3] // cubic mile_min = 60 [s] // minute_mJ = 10^-6 [kJ] // milli Joule_MJ = 1000 [kJ] // mega Joule_mL = 10^-6 [m^3] // milli-liter, _cc = _cm^3_mm = 0.001 [m] // millimeter_mm2 = 10^-6 [m^2] // square millimeter_mm3 = 10^-9 [m^3] // cubic millimeter_mmAq = 0.00980638 [kPa] // mm of water_mmHg = 0.13332237 [kPa] // mm of mercury, _torr_MN = 1000 [kN] // mega newton_MPa = 1000 [kPa] // mega Pascal_mph = 0.44704 [m/s] // mile per hour, _mi/_hr_ms = 0.001 [s] // milli second_mum = 10^-6 [m] // micrometer, micron_mus = 10^-6 [s] // micro second_MW = 1000 [kW] // mega Watt_mW = 10^-6 [kW] // milli Watt_N = 0.001 [kN] // newton_nm = 10^-9 [m] // nano meter_nmi = 1852 [m] // nautical mile_ns = 10^-9 [s] // nano second_oz = 0.0283495 [kg] // ounce-mass, or _ozm_ozf = 0.000278014 [kN] // ounce-force_Pa = 0.001 [kPa] // Pascal_pc = 3.0857 x 10^16 [m] // parsec_pdl = 0.000138255 [kN] // poundal_psi = 6.8947573 [kPa] // _lbf/_in^2_psf = 0.047880279 [kPa] // _lbf/_ft^2_pt = 473.1765 x 10^-6 [m^3] // pint_Pt = 568.26125 x 10^-6 [m^3] // pint(UK) //_Pint_py = 3.30579 [m^2] // pyung_qt = 946.35296 x 10^-6 [m^3] // quart_Qt = 1136.5225 x 10^-6 [m^3] // quart(UK) //_Quart_s = 1 [s] // second_slug = 14.5939 [kg] // slug_stone = 6.3502932 [kg] // stone_tbsp = 14.78676 x 10^-6 [m^3] // tablespoon_Tbsp = 14.20653125 x 10^-6 [m^3] // tablespoon(UK)_therm = 105480.4 [kJ] // (US)_Therm = 105505.59 [kJ] // (Europe)

16

Page 17: Web viewwhere eps = 1.e-6 is by default specified. Then, the above operation states that two real numbers are approximately equal if they are equal up to the 6 digits, or if

[100] 209 double, FastRead-Tutorial by www.msharpmath.com

_ton = 1000 [kg] // ton_Ton = 907.1847 [kg] // English ton_tonf = 9.80665 [kN] // ton-force_Tonf = 8.8964432 [kN] // English ton-force_torr = 0.13332237 [kPa] // torr, mmHg_tsp = 4.92892 x 10^-6 [m^3] // teaspoon_Tsp = 3.5516328125 x 10^-6 [m^3] // teaspoon(UK)_W = 0.001 [kW] // Watt_week = 604800 [s] // week_Wh = 3.6 [kJ] // _W*_hr_yd = 0.9144 [m] // yard_yd2 = 0.83612736 [m^2] // square yard_yd3 = 0.764554857984 [m^3] // cubic yard_yr = 31536000 [s] // non-leap year

//----------------------------------------------------------------------// end of file//----------------------------------------------------------------------

17