Closed Thread
Results 1 to 7 of 7

Thread: Small noob question !

  1. #1
    Join Date
    May 2008
    Location
    Hell
    Posts
    3,852
    Blog Entries
    4
    Rep Power
    49

    Small noob question !

    Hey guys small question, I have not understood the full potential with this bit...
    Code:
    include <cmath>
    Could anyone tell me in brief what I could do with, the lib?
    I have tried to check some e books and e Articels I just find them to be hard to understand

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Phoenixz is offline Programming Professional
    Join Date
    Dec 2008
    Posts
    256
    Blog Entries
    1
    Rep Power
    13

    Re: Small noob question !

    You can read about it here;

    cmath (math.h) - C++ Reference

  4. #3
    Join Date
    May 2008
    Location
    Hell
    Posts
    3,852
    Blog Entries
    4
    Rep Power
    49

    Re: Small noob question !

    I read it, however I couldn't get a grip of it !

  5. #4
    Join Date
    Oct 2008
    Location
    Istog, Kosova
    Posts
    4,001
    Blog Entries
    1
    Rep Power
    40

    Re: Small noob question !

    if u want to use mathematical functions like sin, cos, tg etc etc etc u must first include <math.h>

    Interested in participating in community events?
    Want to harness your programming skill and turn it into absolute prowess?
    Come join our programming events!

  6. #5
    Join Date
    May 2008
    Location
    Hell
    Posts
    3,852
    Blog Entries
    4
    Rep Power
    49

    Re: Small noob question !

    Quote Originally Posted by MathXpert View Post
    if u want to use mathematical functions like sin, cos, tg etc etc etc u must first include <math.h>

    Okay, but then what is "<cmath> for?

  7. #6
    Join Date
    Jan 2009
    Location
    USA
    Posts
    28
    Rep Power
    0

    Re: Small noob question !

    It is non standard to use C style headers for a C standard library in C++. C++ uses c in front of all the headers and has no extension.
    #include <cstdio> = #include <stdio.h>
    #include <cstdlib> = #include <stdlib.h>
    #include <cstring> = #include <string.h>

    And if you are still wondering about cmath's purpose, like MathXpert said. It defines very common math functions so you don't have to re implement them yourself.Also they sometimes use assembler to speed up computations by taking advantages of the native architecture.
    I'm the master of code rot

  8. #7
    Join Date
    May 2008
    Location
    Hell
    Posts
    3,852
    Blog Entries
    4
    Rep Power
    49

    Re: Small noob question !

    Quote Originally Posted by Coder Zombie View Post
    It is non standard to use C style headers for a C standard library in C++. C++ uses c in front of all the headers and has no extension.
    #include <cstdio> = #include <stdio.h>
    #include <cstdlib> = #include <stdlib.h>
    #include <cstring> = #include <string.h>

    And if you are still wondering about cmath's purpose, like MathXpert said. It defines very common math functions so you don't have to re implement them yourself.Also they sometimes use assembler to speed up computations by taking advantages of the native architecture.
    Okay !

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP noob question
    By delta9r9r in forum PHP Development
    Replies: 7
    Last Post: 07-17-2011, 03:19 PM
  2. C# noob question 3, list question
    By Siten0308 in forum C# Programming
    Replies: 3
    Last Post: 01-21-2010, 07:41 AM
  3. Question from a noob...
    By mcg_999 in forum General Programming
    Replies: 1
    Last Post: 10-29-2008, 02:29 PM
  4. A noob question?
    By MPax in forum C and C++
    Replies: 6
    Last Post: 04-03-2008, 08:27 AM
  5. web dev noob question
    By jub jub jedi in forum General Programming
    Replies: 1
    Last Post: 03-26-2007, 04:41 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts