Here is a sample program (from "The Art of ARM Assembly, Volume 2") that converts a 64-bit double-precision floating-point value to a string. This code was created and tested on a Pi 400 using a 32-bit version of PiOS. It easily ports to Cortex-M7F CPUs (e.g., the Teensy 4.x) and other 32-bit based ARM systems running Linux.
This conversion has been written to improve performance. To that end it uses large lookup tables for various floating-point operations and mantissa-to-string conversions.
Enjoy,
Randy Hyde
32-bit double-precision float-to-string
32-bit double-precision float-to-string
- Attachments
-
- Listing10-3.zip
- (108.75 KiB) Downloaded 106 times