math.h

This is a discussion on math.h within the C++ Programming forums, part of the General Programming Boards category; I am trying to write a fnct that will do the following Z = X * log 2 Y but ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    94

    math.h

    I am trying to write a fnct that will do the following

    Z = X * log2 Y

    but dont know how I can use log() for this or if I should be using something else for it Any feedback will be greatly appreciated.

    Thanx
    simple is always an understatement.....

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    there is a log2() fxn in math.h

    edit: takes a double, returns a double
    Last edited by alpha; 05-04-2003 at 11:44 PM.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    New Headers:
    #include <cmath>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. math.h
    By tsutharssan in forum C Programming
    Replies: 3
    Last Post: 07-03-2009, 03:24 PM
  2. Trig Functions without math.h
    By daltore in forum C Programming
    Replies: 13
    Last Post: 12-29-2008, 04:47 PM
  3. cosine series with out using math.h
    By indrajit_muk in forum C Programming
    Replies: 5
    Last Post: 12-16-2008, 08:17 PM
  4. undefined reference to `sqrt' when using math.h
    By Milhas in forum C Programming
    Replies: 4
    Last Post: 03-31-2008, 07:11 PM
  5. using round from math.h
    By axr0284 in forum C Programming
    Replies: 5
    Last Post: 05-02-2006, 12:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21