Skip to content

How to Round Down a Number to the Nearest Integer in C#: .NET 10 update - #2328

Open
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/86495-csharp-round-down-a-number-to-a-nearest-integer
Open

vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/86495-csharp-round-down-a-number-to-a-nearest-integer

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the RoundDownToNearestInteger sample to net10.0 with MSTest 4.5.1, adds the RoundUpUsingMathCeiling and DivideAndRoundDown methods the updated article shows, adds tests for rounding up, floored integer division, saturating out-of-range casts and the Convert.ToInt32 overflow, and makes the console output print with the invariant culture so it matches the article on every machine.

…red division samples

Both projects target net10.0, MSTest 4.5.1, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0. Adds RoundUpUsingMathCeiling and DivideAndRoundDown with tests, tests for out-of-range casts and Convert.ToInt32 overflow, prints results with the invariant culture, and uses file-scoped namespaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant