C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
log and exp in math.h Posted by FlyingNosehair on 2 Feb 2010 at 10:50 AM
Does anyone know how the functions log and exp work in math.h or where I can find out how they work?
Report
Re: log and exp in math.h Posted by anthrax11 on 2 Feb 2010 at 11:32 AM
Report
Re: log and exp in math.h Posted by FlyingNosehair on 3 Feb 2010 at 11:37 AM
Yes, that's right. It didn't. All I could find when I typed that or similar queries was information about their definitions (such as what type of variable they return, what type of variable they accept, and a brief description of what they do). I found nothing like information on how they were programmed. Nothing like source code for them.
Report
Re: log and exp in math.h Posted by FlyingNosehair on 4 Feb 2010 at 10:27 AM
Come to think of it, maybe I should clarify what I mean. I don't simply want to know what to pass to the functions and what they return. I want to know how they work "under the covers". Do they use something like a Taylor series? Ideally, I'd like the source code for them.
Report
Re: log and exp in math.h Posted by anthrax11 on 4 Feb 2010 at 11:19 AM
I see. Well, I'm no expert on this, but I can point you to a couple of open-source implementations of libc. Here you can find the math functions not specific to a platform (if I understand correctly):
http://sourceware.org/git/?p=glibc.git;a=tree;f=math;
http://git.uclibc.org/uClibc/tree/libm

The platform-dependant implementations of log and exp can be found in the sysdeps directory. Look for the fpu directory under each of the platform directories.
http://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps;

You can also get a local copy of the whole library for easier access:
http://ftp.gnu.org/gnu/glibc/

I hope this helps.
Report
Re: log and exp in math.h Posted by FlyingNosehair on 5 Feb 2010 at 3:25 PM
Thanks, it did.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.