© Carlo Milanesi 2018
Carlo MilanesiBeginning Rusthttps://doi.org/10.1007/978-1-4842-3468-6_6

6. Using Primitive Types

Carlo Milanesi1 
(1)
Bergamo, Italy
 
In this chapter, you will learn:
  • How to write numeric literals in hexadecimal, octal, or binary notation

  • How to use the underscore character to make numeric literals easier to read

  • How to use the exponential notation to write huge or tiny numbers in a compact form

  • Which are the ten primitive integer numeric types, and the two primitive floating-point numeric types; which are their ranges; and when it is better to use each of them

  • How to specify numeric literals of concrete types or of unconstrained types

  • How to convert a numeric value to another numeric type

  • The other primitive types: Booleans, characters, ...

Get Beginning Rust: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.