O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unsafety

There are many kinds of unsafety in programming. A practical way to think about it is to say that anything that can cause problems in a running program can be labeled as unsafe. The level of unsafety depends on how destructive the problems may be, how predictable they are, and how easy they are to find and fix. A few examples:

  • A program uses floating-point numbers to store money. However, floating point numbers are not exact and may easily cause rounding errors. The impact depends on the situation: in some cases, being off by the thousands of cents may be OK, but, in accounting, the money values must be exact. This error is somewhat predictable (since, given the same input, it always manifests itself in the same way) and easy to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required