数学的関数

  • 新着順
  • 閲覧数
  • いいね

2019/07/17 19:00
double MathAbs( double value) 指定された数値の絶対値を返す。 Parameters: value - 数値 Sample: double dx=-3.141593, dy; // calc MathAbs dy=MathAbs(dx); Print("The absolute value of “,dx,” is ",dy); // Output: The absolute value of -3.141593 is 3.141593
172
0
1
0
2019/07/17 19:00
double MathCeil( double x) MathCeil関数はxより大きく最も小さい整数を返す Parameters: x - 数値 Sample: double y; y=MathCeil(2.8); Print("The ceil of 2.8 is ",y); y=MathCeil(-2.8); Print("The ceil of -2.8 is ",y); /Output: The ceil of 2.8 is 3 The ceil of -2.8 is -2/
68
0
0
0
2019/07/17 19:00
double MathFloor( double x) MathFloor関数はxより小さく最も大きい整数を返す Parameters: x - 数値 Sample: double y; y=MathFloor(2.8); Print("The floor of 2.8 is ",y); y=MathFloor(-2.8); Print("The floor of -2.8 is ",y); /Output: The floor of 2.8 is 2 The floor of -2.8 is -3/
72
0
0
0
2019/07/17 19:00
double MathMax( double value1, double value2) MathMax関数は2数の最大値を返す。 Parameters: value1 - 数値1 value2 - 数値2 Sample: double result=MathMax(1.08,Bid);
78
0
0
0
2019/07/17 19:00
double MathMin( double value1, double value2) MathMin関数は2数の最小値を返す Parameters: value1 - 数値1 value2 - 数値2 Sample: double result=MathMin(1.08,Ask);
83
0
0
0
2019/07/17 19:00
double MathMod( double value, double value2) この関数は2数の除算の余り (小数)を返す。 MathMod関数はx / yの余り fを計算する。これは x = i * y + f となり、ここでiは整数、fはxと同じ符号を持ち、fの絶対値はyの絶対値よりも小さい。 Parameters: value - 割られる数 value2 - 割る数 Sample: double x=-10.0,y=3.0,z; z=MathMod(x,y); Print("The remainder of “,x,” / “,y,” is "
178
0
0
0
2019/07/17 19:00
double MathPow( double base, double exponent) ある値の累乗を返す Parameters: base - 基本値 exponent - 累乗 Sample: double x=2.0,y=3.0,z; z=MathPow(x,y); Printf(x," to the power of “,y,” is ", z); //Output: 2 to the power of 3 is 8
198
0
0
0
2019/07/17 19:00
double MathRound( double value) 指定した値の四捨五入した値を返す。 Parameters: value - 数値 Sample: double y=MathRound(2.8); Print("The round of 2.8 is ",y); y=MathRound(2.4); Print("The round of -2.4 is ",y); //Output: The round of 2.8 is 3 // The round of -2.4 is -2
74
0
0
0
2019/07/17 19:00
double MathSqrt( double x) MathSqrt関数はxの平方根を返す。もしxが負の数であればMathSqrt関数は無限大を返す(NaNと同等)。 Parameters: x - 正の数値 Sample: double question=45.35, answer; answer=MathSqrt(question); if(question Print(“Error: MathSqrt returns “,answer,” answer”); else Print("The square root of “,question,” is ",
70
0
0
0
2019/07/17 19:00
int MathRand() MathRand関数は0から32767の範囲で疑似乱数を発生させる。MathRandを呼ぶ前にMathSrand関数を用いて、疑似乱数発生の発生系列を指定するべきである。 Sample: MathSrand(TimeLocal()); // Display 10 numbers. for(int i=0;i Print("random value ", MathRand());
74
0
0
0