SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Function and Math Exponent

    This is the forumalu I'm trying to make javascript perform for me... (1 + R)^N

    It is for a class assignment(and he doesn't teach anything relevant to the javascript assignment in his class). That's besides the point...this is what I have so far.

    function exponent(N,R) {
    var answer;
    answer =

    How to perform the actual formula has got me...any help is much appreciated.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need Math.pow().
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    answer = Math.pow(1+R, N);

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Joe, take a few minutes each day to browse around in the Javascript Reference simply out of curiosity. When it comes time to solve some Js problem, it is very likely that you will remember seeing something useful in the reference. Then go to back to the ref and get the details.


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
  •