do not click

Meeting C++ 2025   |  Online   |  Training   |  Books   |  Survey   |  Job fair   |  Advertising   |  Jobposting   |  Login

Meeting C++ 2025 - int != safe && int != ℤ

Conference | Live Schedule | Talks | Get your ticket | Slides | Set your timezone

int != safe && int != ℤ

Join session

Peter Sommerlad

On Day 3 at 10:20 (CET/Berlin) in Track C [Jade Room and online]

C++ integers suffer from potential inaccuracy in arithmetic operations as well as undefined behavior.

This talk shows the risks involved in inappropriate integer operations and the problems with integral promotion and the "usual arithmetic conversions" that in addition to the original operands types can further confuse programmers.

We will take a look at MISRA C++ guidelines with respect to integer arithmetic and operations and see where are their limitations in static analysis.

However, the power of C++ and new standard library features will allow us to implement safer alternatives. It might be a bit of art required to actually achieve syntactical nicety, efficient implementation and well-defined behavior when dealing with whole numbers and integers. 

Note: this talk will not include approaches for unlimited precision arithmetic that might be required for some domains.

Please login to comment

Copyright Meetingcpp GmbH Imprint Privacy Policy