Give feedback

How would you rate this Learning Path?

Review frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I build the examples?
Compile the C source as C and the C++ source as C++ with a recent GCC or Clang on your Arm Linux system. Run the binaries and compare their output. A narrowing diagnostic from the C++ brace-initialization example is expected.
What result should I expect from the golden ratio program?
The ratio approaches 1.6180339887… as the Fibonacci index increases. If the output stays at whole numbers or fails to converge, check for integer division and promote one operand to a floating-point type.
How do I know an implicit conversion is changing my calculation?
Inspect the operand types in each expression. Two integer operands produce integer arithmetic, so promote one value or cast it to float or double when you need a fractional result.
Why does the C++ demotion example behave differently with braces?
C++ list initialization with braces can diagnose narrowing conversions at compile time, so float z{w} can produce a diagnostic. An assignment such as float y = w usually compiles and truncates the value at runtime.
What should I change if the demotion test prints unexpected values?
Use a wider destination type for intermediate results when you need to preserve range and precision. Add an explicit conversion only when truncation is intentional, then rebuild and recheck the output.

Share

Tell others about this Learning Path.