mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-11 17:24:29 +02:00
add missing semicolons in c.html.markdown
This commit is contained in:
@@ -183,8 +183,8 @@ int main() {
|
|||||||
i1 / i2; // => 0 (0.5, but truncated towards 0)
|
i1 / i2; // => 0 (0.5, but truncated towards 0)
|
||||||
|
|
||||||
// You need to cast at least one integer to float to get a floating-point result
|
// You need to cast at least one integer to float to get a floating-point result
|
||||||
(float)i1 / i2 // => 0.5f
|
(float)i1 / i2; // => 0.5f
|
||||||
i1 / (double)i2 // => 0.5 // Same with double
|
i1 / (double)i2; // => 0.5 // Same with double
|
||||||
f1 / f2; // => 0.5, plus or minus epsilon
|
f1 / f2; // => 0.5, plus or minus epsilon
|
||||||
// Floating-point numbers and calculations are not exact
|
// Floating-point numbers and calculations are not exact
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user