Mid-point and linear interpolation done right
Posté par Olivier dans Trucs & Astuces le 22 mai 2025
How many times did we write code like: Although this code is correct, it may suffer from overflows. The typical way to avoid those is to cast to a wider type. But how can you do this when the start and stop values are already using the largest integer type (eg. int64_t) ? The C++ […]
The hidden cost of std::ranges
Posté par Olivier dans Trucs & Astuces le 22 mai 2025
At work, we have recently adopted some commercial static checker to hunt bugs in our codebase. The tool does not only identify bugs and security vulnerabilities. It is also advising you on opportunities to modernize your code to use the latest and greatest of the C++ language and of its standard library. One of the […]
Filets de poulet gratinés à la sauce tomates (4P)
ingrédients préparation
Pâtes aux tomates et burrata (4 P)
Ingrédients Préparation
Cabillaud au lait de coco et noix de cajou
Ingrédients Préparation
Chili con carne (4 pers)
Ingrédients Préparation
Poulet sauce chorizo
Pour 5 personnes Ingrédients Préparation
Overflow-safe integer mul&div
Posté par Olivier dans Trucs & Astuces le 22 décembre 2023
When you do a multiply & divide operation, to ensure you don’t loose precision, you would start by the multiplication before the division. But in that case, it could be that the result of the multiplication overflows. The natural solution would go to use an intermediate storage of larger size. This uses concepts (C++20). For […]
Crèpes à la façon du Mont
Lors d’un séjour au Mont-Saint-Michel, le patron du B&B où nous séjournions, nous préparait chaque matin des crèpes légères et gouteuses. Il a eu la gentillesse de nous livrer sa recette. Ingrédients Pour 6 personnes 40g de beurre fondu 250g de farine 40g de sucre 60cl de lait 4 oeufs 1 cuillère à soupe de […]
Le Cancre Las
En 1988, les élèves à l’Athenée Maurice Carême de Wavre se sont lancés dans un projet fou: créer un journal. La fine petite équipe a eu le soutien de l’école et de ses professeurs ainsi que de commerces locaux (p.ex. le disquaire La Lyre d’Or). Résultat: 4 numéros (que je viens de retrouver en triant […]