Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7005239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:19:34+00:00 2026-05-27T21:19:34+00:00

The interface on my build system MacOS 10.6.3 for the POSIX math library is

  • 0

The interface on my build system MacOS 10.6.3 for the POSIX math library is math.h, however on my target system the name of the interface file is cmath.h. At school we use cmath and I would like to be sure my project compiles when it is handed in, how is this achieved. The servers and workstations at school are x86 running Windows XP. The GCC is available on both platforms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:19:35+00:00Added an answer on May 27, 2026 at 9:19 pm

    In the C++ standard, the math library functions are defined in two headers:

    <cmath>
    

    contains them in the namespace std (e.g. std::sin), while

    <math.h>
    

    contains them in the global namespace (so just sin).

    There are further differences between the two: while <math.h> contains all the C math functions with distinct names for distinct types, such as

    double sin(double);
    float sinf(float);
    long double sinl(long double);
    

    etc., <cmath> contains overloaded functions such as

    namespace std {
        double sin(double);
        float sin(float);
        long double sin(long double);
    }
    

    etc. (C++ libraries might additionally export sinf from <cmath>, but you can’t rely on this in a portable program.)

    Finally, the fabs, fabsf and fabsl functions from the C standard library have become overloads of std::abs in <cmath>.

    Though both headers are in the standard, you should really prefer <cmath>, as <math.h> is only there for backward compatibility with pre-standard C++ and C.

    There’s no such thing as <cmath.h> in standard C++.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to build a scripting interface for my C# program that does system
We using an automated build system which downloads and compiles source. The only interface
I want to build a user interface similar to the sketch below: When the
I want to build a webapplication with a Single Page Interface, using ASP.NET MVC.
I've build the following case. An interface for all JAXBLists: public interface JaxbList<T> {
I'm trying to build a generic web service interface using WCF, to allow 3rd
I'm wondering how the best way to build a way to interface with Yahoo
I'm trying to build a system ontop of event machine that will detect when
i'm trying to build a semi file sharing program, when each computer acts both
I want to automatically deploy a EAR file build in our continuous integration server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.