int()
原文
値をintデータ型に変換します。 次に例を示します。
code:sample1.ino
double d = 2.5;
int i = int(d); // i holds "2", an int value
かっこの中の値(int(...))は、任意の型にすることができます。 しかし、数値型(double、charなど)でなければ、奇妙な結果が得られます。
Maple上のint変数の精度と制限の詳細については、intのリファレンスを参照してください。
関連項目
int
License and Attribution: Portions of this page were adapted from the Arduino Reference Documentation, which is released under a Creative Commons Attribution-ShareAlike 3.0 License.
このドキュメントはleafLabs, LLC.が執筆し、たま吉が翻訳・一部加筆修正したものです。
Arduino STM32 リファレンス 日本語版 に戻る