Decimal floating point to binary floating point
12-25-2018, 04:06 AM
Post: #1
 Dan Member Posts: 162 Joined: Jan 2017
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 »

 Messages In This Thread Decimal floating point to binary floating point - Dan - 12-25-2018 04:06 AM RE: Decimal floating point to binary floating point - Thomas Klemm - 12-25-2018, 08:32 AM RE: Decimal floating point to binary floating point - Albert Chan - 12-25-2018, 11:37 PM RE: Decimal floating point to binary floating point - Dan - 12-26-2018, 07:10 AM RE: Decimal floating point to binary floating point - Paul Dale - 12-26-2018, 07:51 AM RE: Decimal floating point to binary floating point - Dan - 01-03-2019, 06:53 AM RE: Decimal floating point to binary floating point - Dan - 12-26-2018, 08:46 AM RE: Decimal floating point to binary floating point - BruceH - 12-30-2018, 05:46 PM RE: Decimal floating point to binary floating point - SlideRule - 12-30-2018, 11:36 PM RE: Decimal floating point to binary floating point - Thomas Klemm - 12-26-2018, 11:14 AM RE: Decimal floating point to binary floating point - Dan - 12-28-2018, 03:45 AM RE: Decimal floating point to binary floating point - Paul Dale - 12-28-2018, 09:33 AM RE: Decimal floating point to binary floating point - Dan - 01-01-2019, 07:27 AM

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