atof
提供: cppreference.com
|
|
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
<metanoindex/>
<tbody> </tbody>| ヘッダ <stdlib.h> で定義
|
||
double atof( const char* str ); |
||
strが指すバイト列の浮動小数点値を解釈.Original:
Interprets an floating point value in a byte string pointed to by
str.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
最初の非ホワイトスペース文字が見つかるまで、あらゆるホワイトスペース文字を破棄します (ホワイトスペースは std::isspace() によって判定されます)。 その後、有効な浮動小数点表現を形成する文字を可能な限り多く読み込み、それを浮動小数点値に変換します。 有効な浮動小数点値は以下のいずれかです。
- 10進数の浮動小数点表現。 これは以下の部分から構成されます。
- (オプション) 正または負の符号。
- 空でない10進数字の並び。 オプションの小数点文字 (現在の C のstd::setlocaleによって決定されます) を含むこともできます。 仮数部を定義します。
- (オプション)
eまたはE、それに続くオプションの正または負の符号、および空でない10進数字の並び。 底を10とする指数を定義します。
- 16進数の浮動小数点表現。 これは以下の部分から構成されます。
- (オプション) 正または負の符号。
0xまたは0X。- 空でない16進数字の並び。 オプションの小数点文字 (現在の C のstd::setlocaleによって決定されます) を含むこともできます。 仮数部を定義します。
- (オプション)
pまたはP、それに続くオプションの正または負の符号、および空でない10進数字。 底を2とする指数を定義します。
- 無限大の表現。 これは以下の部分から構成されます。
- (オプション) 正または負の符号。
INFまたはINFINITY。 大文字小文字の違いは無視されます。
- 非数の表現。 これは以下の部分から構成されます。
- (オプション) 正または負の符号。
NANまたはNAN(char_sequence)。NAN部分の大文字小文字の違いは無視されます。 char_sequence 部分は数字、ラテン文字およびアンダースコアのみ含むことができます。 結果は quiet NaN の浮動小数点値です。
- 現在設定されている C のstd::setlocaleによって受理される、その他のあらゆる表現。
パラメータ
| str | - | 解釈されるNULL終端バイト文字列へのポインタ
Original: pointer to the null-terminated byte string to be interpreted The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
値を返します
double成功した場合にstrの内容に対応した値。変換された値が戻り値の型の範囲から外れた場合、戻り値は未定義です。変換を実行できなかった場合は、0.0が返されます。.Original:
double value corresponding to the contents of str on success. If the converted value falls out of range of the return type, the return value is undefined. If no conversion can be performed, 0.0 is returned.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
例
| This section is incomplete Reason: no example |
も参照してください
テンプレート:c/string/byte/dcl list strtofC++ documentation for atof
|