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!

Floating Point Math Library for PIC32


Microchip’s ANSI C compiler provides full floating point math capability, enabling both the single and double precision floating point operations found in any standard ANSI C compiler. These include functions such as sin, cos, tan, and other common mathematical operations. The standard ANSI C floating point library is part of the MPLAB compiler and is documented in the MPLAB C32 C Libraries Manual. The library works with all PIC32 devices

         

Common Floating Point Functions

 

Features

Function

Description

Average Single Precision Performance

 

• Free library included with MPLAB compiler

• Compatible with all devices in the Microchip PIC32 family

• Full compatibility with standard ANSI C floating point math libraries.

• Support for double or single precision floating point

• Includes common operations such as sin, cos, tan, etc.

Getting Started
• Download and install MPLAB and the free trial version of the C32 C compiler

• See Chapter 2 of the MPLAB C32 C Libraries Manual

• Start writing floating point code!

sin/sinf*

Sin of a double/single precision floating point variable

299 cycles

 

cos/cosf*

Cos of a double/single precision floating point variable

299 cycels

 

tan/tanf*

Tan of a double/single precision floating point variable

389 cycles

 

exp/expf*

Calculates the exponential function of a double/single precision floating point variable

133 cycles

 

fabs/fabsf*

Calculates the absolute value of a double/single precision floating point variable

6 cycles

 

fmod/fmodf*

Calculates the remainder of x/y as a double/single precision floating point value

86 cycles

 

log/logf*

Calculates the log of a double/single precision variable

301 cycles

 

sqrt/sqrtf*

Calculates the square root of a double/single precision variable

237 cycles

 

pow/powf*

Calculates x raised to the power of y

367 cycles

 

floor/floorf*

Calculates the floor of a double/single precision floating point variable

33 cycles

 

ceil/ceilf*

Calculates the ceiling of a double/single precision floating point variable

34 cycles

 

asin/asinf*

Arc sin of a double/single precision floating point variable

618 cycles

 

acos/acosf*

Arc cos of a double/single precision floating point variable

685 cycles

 

atan/atanf*

Arc tan of a double/single precision floating point variable

353 cycles

 

*- “f” denotes single precision floating point number

Floating Point Math Library for PIC32


Title
Date
32-Bit Language Tools Libraries 19 Jun 2015 Download
MPLAB® Assembler, Linker and Utilities for PIC32 MCUs User's Guide 19 Jun 2015 Download
MPLAB® Assembler, Linker and Utilities for PIC32 MCUs User's Guide 19 Jun 2015 Download
30009962D.indd 19 Jun 2015 Download
50001894D.indd 19 Jun 2015 Download
MPLAB XC32 C/C++ Compiler User's Guide 19 Jun 2015 Download
MPLAB® C Compiler for PIC32 MCUs User's Guide 19 Jun 2015 Download
mplabc32_v2_02a_windows_installer (1) 19 Jun 2015 Download