File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,15 @@ auto net_worth_carlisle_cullen{46'000'000'000LL}; // int and uint are not enough
33
33
Floating-point numbers usually resolve to `double` during compilation.
34
34
This is a good default case and use-cases with the narrower `float` type are less frequent than the unsigned example above.
35
35
36
+ ~~~~exercism/advanced
37
+ The [C++23 standard][cpp23-literals] introduces more fine grained control with literals like `f128` or `F16`.
38
+ Some compilers allow their own literals.
39
+ GCC permits the usage of `d` as a literal, but this is not foreseen in the standard and can hinder cross-platform compatibility.
40
+
41
+ [cpp23-literals]: https://en.cppreference.com/w/cpp/language/floating_literal
42
+
43
+ ~~~~
44
+
36
45
```cpp
37
46
auto light_year_in_m{9.46073e+15f}; // well in the range of float
38
47
auto earth_to_edge_comoving_distance_in_nm{4.32355e+32}; // needs double type for magnitude
You can’t perform that action at this time.
0 commit comments