Skip to content

crow3080/Round

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Arithmetic Rounding in Rust ๐Ÿฆ€

A simple and educational Rust program that performs arithmetic rounding โ€” rounding any number entered by the user to the nearest whole number using standard mathematical logic.


๐Ÿงฎ What It Does

When you run the program, it:

  1. Prompts the user to enter a number (for example: 3.6 or -2.4).
  2. Calculates the fractional part of the number.
  3. Decides whether to round up or down based on standard rounding rules.
  4. Displays the step-by-step reasoning and the final rounded result.

๐Ÿ“˜ Example Run

Enter a number: 3.6

You entered: 3.6
Step 1: The fractional part is 0.6
Step 2: Since 0.6 >= 0.5, we round up
Result: 4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages