Files
100-exercises-to-learn-rust/book/src/02_basic_calculator/00_intro.md
LukeMathWalker 4401743807 Formatter
2024-05-24 18:16:20 +02:00

687 B
Raw Blame History

A Basic Calculator

In this chapter well learn how to use Rust as a calculator.
It might not sound like much, but itll give us a chance to cover a lot of Rusts basics, such as:

  • How to define and call functions
  • How to declare and use variables
  • Primitive types (integers and booleans)
  • Arithmetic operators (including overflow and underflow behavior)
  • Comparison operators
  • Control flow
  • Panics

Nailing the basics with a few exercises will get the language flowing under your fingers. When we move on to more complex topics, such as traits and ownership, youll be able to focus on the new concepts without getting bogged down by the syntax or other trivial details.