Decimal floating point to binary floating point

12252018, 04:06 AM
Post: #1




Decimal floating point to binary floating point
I've been writing firmware for a hobby calculator project using BCD. Today I was looking at the datasheet for the ARM Cortex M4 (for the TI Tiva C Launchpad microcontroller) and was impressed to see a hardware implementation of +,,*,/ and square root for floating point numbers in IEEE754 single precision format.
I've seen a few tutorials on how to convert decimal numbers like 8.25 to binary floating point format and I should be able to code the algorithm but I'm not sure about an algorithm for converting larger numbers like 8.25 * 10^84 to binary floating point, i.e. I'm not sure what's the best way to deal with the 10^84 part. Now 10^84 = 2^84 * 5^84 but then you have to deal with 5^84. I want to code an algorithm that converts decimal floating point numbers entered by the user to binary floating point numbers in order to exploit the Cortex floating point instructions. 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)