exponents

This is a discussion on exponents within the C++ Programming forums, part of the General Programming Boards category; I need help with a small bit of coding... explain what I did wrong too as I am a n00b ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    5

    exponents

    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    > 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, 09: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, 08:09 PM
  5. For loop and exponents
    By TrazPFloyd in forum C++ Programming
    Replies: 5
    Last Post: 10-15-2002, 05:19 AM

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