From c8a0f117b2f325aa71f05aa7568ba04d4f0ca5b6 Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Thu, 26 Jan 2023 09:13:46 +0000 Subject: [PATCH] Add item for page 128 --- docs/errata/README.md | 2 +- docs/errata/improvements.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/errata/README.md b/docs/errata/README.md index 9795d20..22d1221 100644 --- a/docs/errata/README.md +++ b/docs/errata/README.md @@ -4,6 +4,6 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros [**Errata** (22 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build. -[**Improvements** (3 items)](improvements.md): Changes to text or code that would improve the content. These are optional. +[**Improvements** (4 items)](improvements.md): Changes to text or code that would improve the content. These are optional. All errata and improvements will be included in the 8th edition planned for publishing in November 2023. To be included they must be submitted by mid-September 2023. diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index a9080c5..f329319 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -1,11 +1,16 @@ -**Improvements** (3 items) +**Improvements** (4 items) If you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com. +- [Page 128 - Rounding numbers](#page-128---rounding-numbers) - [Page 153 - Writing a function that returns a value](#page-153---writing-a-function-that-returns-a-value) - [Page 179 - Reviewing project packages](#page-179---reviewing-project-packages) - [Page 453 - Scaffolding models using an existing database](#page-453---scaffolding-models-using-an-existing-database) +# Page 128 - Rounding numbers + +In this section, I wrote about rounding rules as taught in schools and compare them to rounding rules when using C# and .NET. In schools, children are introduced to rounding rules with positive numbers and so learn the term "rounding up" and "rounding down". I did not explicitly say that for negative numbers, those terms would be reversed which can be confusing, so those terms should be avoided. This is why the .NET API uses the enum values `AwayFromZero`, `ToZero`, `ToEven`, `ToPositiveInfinity` and `ToNegativeInfinity` for improved clarity. In the next edition I will add a note about this. + # Page 153 - Writing a function that returns a value At the end of this section there is a note box that explains that we could use the `C` format code to format the output as currency. If you are running on a computer in a culture that uses Euros then to show the Euro currency symbol you must enable UTF-8 encoding.