EmbeddedRelated.com
The 2026 Embedded Online Conference

Never use Float or Integer

Mark HermelingMark Hermeling March 18, 20264 comments

Ada treats numbers as more than just numbers, and that changes how embedded code fails. This post shows why you should avoid using Float and Integer directly, then demonstrates how distinct types, ranges, and subtypes let the compiler catch unit mix-ups and out-of-range values before runtime. It also shows the same code running on a Raspberry Pi Pico, and briefly introduces SPARK for proving correctness.


Never use Float or Integer

Mark HermelingMark Hermeling March 18, 20264 comments

Ada treats numbers as more than just numbers, and that changes how embedded code fails. This post shows why you should avoid using Float and Integer directly, then demonstrates how distinct types, ranges, and subtypes let the compiler catch unit mix-ups and out-of-range values before runtime. It also shows the same code running on a Raspberry Pi Pico, and briefly introduces SPARK for proving correctness.


The 2026 Embedded Online Conference