回答編集履歴
2
書式の改善
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
その前についている`l`は、変数の型のサイズが「long」、この場合は`e`を修飾していて実数なので、long doubleであることを指定しています。
|
5
5
|
|
6
6
|
(追記)
|
7
|
-
Cの場合、引数の`float`は自動的に`double`に格上げされますので、書式指定子
|
7
|
+
Cの場合、引数の`float`は自動的に`double`に格上げされますので、書式指定子`e`や`f`などはそもそも`double`が想定されます。で、それらの前の`l`が特別に`long double`を意味するのはどうやらマイクロソフト独自拡張のようです。
|
8
8
|
|
9
9
|
> In Visual C++, although long double is a distinct type, it has the same internal representation as double.
|
10
10
|
|
1
追記
answer
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
1e-06 は、1×(10の-6乗)、つまり0.000001を表します。
|
2
2
|
-2.3e+03 なら、-2.3×(10の3乗)、つまり-2300 です。
|
3
3
|
書式指定子の`e`は、このような書式を指定するもので、
|
4
|
-
その前についている
|
4
|
+
その前についている`l`は、変数の型のサイズが「long」、この場合は`e`を修飾していて実数なので、long doubleであることを指定しています。
|
5
|
+
|
6
|
+
(追記)
|
7
|
+
Cの場合、引数の`float`は自動的に`double`に格上げされますので、書式指定子'e'や`f`などはそもそも`double`が想定されます。で、それらの前の`l`が特別に`long double`を意味するのはどうやらマイクロソフト独自拡張のようです。
|
8
|
+
|
9
|
+
> In Visual C++, although long double is a distinct type, it has the same internal representation as double.
|
10
|
+
|
11
|
+
_
|
12
|
+
|
13
|
+
> The h prefix when it's used with data of type char and the l (lowercase L) prefix when it's used with data of type double are Microsoft extensions.
|
14
|
+
|
15
|
+
[Format Specification Syntax: `printf` and `wprintf` Functions | Microsoft Docs](https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=msvc-160)
|