Why Does the Str Function Not Round Correctly?

Any decimal/float number has an internal binary representation. Unfortunately, you can never be sure if a decimal value has an exact representation in its binary pendant. If an exact binary representation is not possible (mathematical constraint), the nearest value is used and this leads to the issue where it seems the str function is not rounding correctly. You can workaround this issue. Use the following code to see the internal representation:
[ ] printf("%.a20e\n", 32.495) 
[ ] printf("%.a20e\n", 31.495)