Liangxu Linux
Liangxu Linux
Feb 29, 2024 · Fundamentals

Master static, volatile, sizeof, and I2C for Embedded C

This guide explains the purposes and effects of the C/C++ static and volatile keywords, compares the sizeof operator with strlen, describes reliable methods for comparing floating‑point numbers, outlines how floating‑point operations affect STM32 interrupt performance, and provides a concise overview of the I²C protocol and address configuration on STM32 devices.

C++I2CSTM32
0 likes · 9 min read
Master static, volatile, sizeof, and I2C for Embedded C
ELab Team
ELab Team
Jul 14, 2022 · Frontend Development

Why JavaScript’s toFixed Fails at Precise Rounding and How to Fix It

JavaScript’s built‑in toFixed cannot reliably perform true rounding due to binary floating‑point precision limits, so this article explains the underlying IEEE‑754 representation, demonstrates common pitfalls, and provides a custom rounding algorithm with code examples to achieve accurate decimal rounding.

IEEE-754PrecisionRounding
0 likes · 10 min read
Why JavaScript’s toFixed Fails at Precise Rounding and How to Fix It