Skip to content

Commit d1b9b0e

Browse files
author
Svetlin Nakov
committed
Updates Content/Chapter-2-1-simple-calculations/concatenating-text-and-numbers/concatenating-text-and-numbers.md
Auto commit by GitBook Editor
1 parent fbad3bf commit d1b9b0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Content/Chapter-2-1-simple-calculations/arithmetical-operations/arithmetical-operations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ var product = a * b; // 35
4545

4646
**Dividing** numbers is done using the `/` operator. It works differently with **integers** and **floating point numbers**.
4747

48-
* When we divide two integers, an **integer division** is applied and the obtained output is without its fractional part. Example: 11 / 3 = 3.
49-
* When we divide two numbers and at least one of them is a float number, a **floating division** is applied and the obtained result is a float number, just like in math. Example 11 / 4.0 = 2.75. When it cannot be done with exact precision, the result is being rounded, for example 11.0 / 3 = 3.66666666666667.
48+
* When we divide two integers, an **integer division** is applied, and the obtained output is without its fractional part. Example: 11 / 3 = 3.
49+
* When we divide two numbers and at least one of them is a float number, a **floating division** is applied, and the obtained result is a float number, just like in math. Example 11 / 4.0 = 2.75. When it cannot be done with exact precision, the result is being rounded, for example 11.0 / 3 = 3.66666666666667.
5050
* The integer **division by 0** causes an **exception** during runtime \(runtime exception\).
5151
* Float numbers **divided by 0** do not cause an exception and the result is **+/- infinity** or a special value **NaN**. Example 5 / 0.0 = ∞.
5252

Content/Chapter-2-1-simple-calculations/concatenating-text-and-numbers/concatenating-text-and-numbers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var sum = "The sum is: " + a + b;
2525
Console.WriteLine(sum); // The sum is: 1.52.5
2626
```
2727

28-
Did you notice **something strange**? Maybe you expected the numbers `a` and `b` to be summed? Actually the concatenation works from right to left and the result above is absolutely correct. If we want to sum the numbers, we have to use **brackets**, in order to change the order of execution of the operations:
28+
Did you notice **something strange**? Maybe you expected the numbers `a` and `b` to be summed? Actually, the concatenation works from right to left and the result above is absolutely correct. If we want to sum the numbers, we have to use **brackets**, in order to change the order of execution of the operations:
2929

3030
```csharp
3131
var a = 1.5;

0 commit comments

Comments
 (0)