We detect you are using an unsupported browser. For the best experience, please visit the site using Chrome, Firefox, Safari, or Edge. X
Maximize Your Experience: Reap the Personalized Advantages by Completing Your Profile to Its Fullest! Update Here
Stay in the loop with the latest from Microchip! Update your profile while you are at it. Update Here
Complete your profile to access more resources.Update Here!

AN660

Title
Title
Floating Point Routines
Name
Name
AN660
Date
Date
06/24/2015
Application Categories
Application Categories
Algorithms (Building Blocks) / Math
Product Categories
Product Categories
16-bit MCUs
8-bit MCU
dsPIC DSCs
Description
Description
This application note presents implementations of the following math routines for the Microchip PICmicro microcontroller family: square root function, exponential function, base 10 exponential function, natural log function, common log function, trigonometric sine function trigonometric cosine function trigonometric sine and cosine functions power function, floor function, largest integer not greater than x, as float, floating point logical comparison tests integer random number generator Routines for the PIC16CXXX and PIC17CXXX families are provided in a modified IEEE 754 32-bit format together with versions in 24-bit reduced format. The techniques and methods of approximation pre-sented here attempt to balance the usually conflicting goals of execution speed verses memory consumption, while still achieving full machine precision estimates. Although 32-bit arithmetic routines are available and constitute extended precision for the 24-bit versions, no extended precision routines are currently supported for use in the 32-bit routines, thereby requiring more sophisticated error control algorithms for full or nearly full machine precision function estimation. Differences in algorithms used for the PIC16CXXX and PIC17CXXX families are a result of performance and memory considerations and reflect the significant platform dependence in algorithm design.

Files

Title Title Download Date Size
AN660 Source Code - Floating Point Routines 343.0 KB 06/24/2015 AN660 Source Code - Floating Point Routines Download 06/24/2015 343.0 KB