0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

P5.js 日本語リファレンス(float)

Last updated at Posted at 2020-08-23

このページでは[「P5.js 日本語リファレンス」] (https://qiita.com/bit0101/items/91818244dc26c767a0fe) の float 関数を説明します。

float()

説明文

文字列をその浮動小数点表現に変換します。文字列の内容は数値に似ている必要があります。そうでない場合、NaN(数値ではない)が返されます。たとえば float("1234.56")は 1234.56 と評価されますが, float("giraffe")は NaN を返します。

値の配列が渡されると、同じ長さの浮動小数点数の配列が返されます。

構文

float(str)

パラメタ

  • str
    String:変換する浮動文字列

戻り値

Number:文字列の浮動小数点表現

例1

print(float('10 .31 ')); // 10.31
print(float('Infinity')); //Infinity
print(float('-Infinity')); //-Infinity

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?