Thread: exponents

  1. #1
    Registered User
    Join Date
    Feb 2002


    I need help with a small bit of coding... explain what I did wrong too as I am a n00b at this and am working on it

    #include <math.h>
    double exp(double x);

    amount = pay * (1 +(rate/n)),exp(n*time);

    It says there is no error, but I think this is the reason my program isn't working. Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > amount = pay * (1 +(rate/n)),exp(n*time);

    Two things
    1. if rate and n are both integers, rate/n isn't likely to be what you want it to be
    2. what's that comma doing? - it does something for sure, just not what you want.

    Oh, one more thing - don't re-prototype functions which are already prototyped by included files.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. exponents are LAAAME
    By Sm33zy in forum C Programming
    Replies: 8
    Last Post: 11-21-2008, 10:10 PM
  2. Fraction Exponents
    By ninjaturtle[k9] in forum C++ Programming
    Replies: 4
    Last Post: 10-18-2004, 10:46 AM
  3. God, i feel like a n00b again. How do i do exponents?
    By Inquirer in forum C++ Programming
    Replies: 13
    Last Post: 09-01-2003, 08:41 PM
  4. how to use exponents
    By guitargatler in forum C++ Programming
    Replies: 11
    Last Post: 02-01-2003, 09:09 PM
  5. For loop and exponents
    By TrazPFloyd in forum C++ Programming
    Replies: 5
    Last Post: 10-15-2002, 05:19 AM