Go to Post STEM blushes, and asks if Art would like to go out for a date. - Cothron Theiss [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 17-01-2005, 01:39
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
Re: New math functions?

They are (straight from math.h):

float fabs (float x); (absolute value)
float ldexp (float x, int n); (computes x*2^n)
float exp (float f); (e^f)
float sqrt (float x);
float asin (float x);
float acos (float x);
float atan2 (float y, float x);
float atan (float x);
float sin (float x);
float cos (float x);
float tan (float x);
float sinh (float x);
float cosh (float x);
float tanh (float x);
float frexp (float x, int *pexp); (splits into the fractional part of a float, which is returned, and the exponent which is stored in the pointer)
float log10 (float x);
float log (float x);
float pow (float x, float y);
float ceil (float x);
float floor (float x);
float modf (float x, float *ipart); (performs the modulus function on x, returns the result and stores the fraction in the pointer. Look in the manual for more explanation)
float fmod (float x, float y); (the remainder for x%y)

float mchptoieee (unsigned long v); (converts the microchip version of 32-bit to ieee standard)
unsigned long ieeetomchp (float v); (mchptoieee in reverse)
-----------------------------------------------------------------------------------

Unfortunately, thay all take floating point inputs and return floats. Its not hard to typecast though. And I, myself, am glad to have a math.h library at my disposal rather than using my own functions, even if it is for 32-bit floats.

If you've already installed the compiler, the manual should be in c:\mcc18\docs\ (or whatever-your-install-directory-is\docs). It has plenty of documentation available. There are also many functions to access deeper features of the chip that took some tricky coding before.

-Tony K
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overloaded functions jgannon Programming 5 31-12-2004 11:04
White Paper Discuss: 296's CORDIC Math Library CD47-Bot Extra Discussion 5 28-04-2004 20:01
Do you write functions for your code? Max Lobovsky Programming 26 11-03-2004 07:04
Logical statements or math formulas Manoel Programming 1 16-02-2002 23:29


All times are GMT -5. The time now is 10:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi