Warning: Trying to access array offset on value of type bool in /home/cycos/cammy.co.jp/public_html/technical/wp-content/themes/cocoon-master/lib/utils.php on line 2604

Warning: Trying to access array offset on value of type bool in /home/cycos/cammy.co.jp/public_html/technical/wp-content/themes/cocoon-master/lib/utils.php on line 2604

Warning: Trying to access array offset on value of type bool in /home/cycos/cammy.co.jp/public_html/technical/wp-content/themes/cocoon-master/lib/utils.php on line 2632

abs

説明

引数に指定した数値の絶対値を計算します。

書き方 num=abs(x)
戻り値 (unsigned long)num
引数 なし

プログラム

void setup() {
  Serial.begin(115200) ;
}

// 繰り返し実行される処理
void loop(){
  int x = abs(-100) ;
  Serial.println(x) ;
}

注意

特になし

タイトルとURLをコピーしました