File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -5681,15 +5681,22 @@ <h3 id="Floating_Literals">Floating-point Literals</h3>
5681
5681
but note that a number in exponential notation is never an integer literal.
5682
5682
</ p >
5683
5683
5684
+ < p class ="drake "> The decimal point may be omitted for exponential powers of 10
5685
+ when the mantissa is exactly one, e.g., < code > 1e3</ code >
5686
+ or < code > 1e-6</ code > .</ p >
5687
+
5684
5688
< pre class ="badcode "> float f = 1.f;
5685
5689
long double ld = -.5L;
5686
5690
double d = 1248e6;
5691
+ < span class ="drake "> double negtol = -1e-3;</ span >
5687
5692
</ pre >
5688
5693
5689
5694
< pre class ="goodcode "> float f = 1.0f;
5690
5695
float f2 = 1; // Also OK
5691
5696
long double ld = -0.5L;
5692
5697
double d = 1248.0e6;
5698
+ < span class ="drake "> double scale = 1e3;</ span >
5699
+ < span class ="drake "> double tol = 1e-6;</ span >
5693
5700
</ pre >
5694
5701
5695
5702
You can’t perform that action at this time.
0 commit comments