Results 1 to 10 of 10

Thread: Exponents in scar?

  1. #1
    Join Date
    Sep 2008
    Location
    New Zealand
    Posts
    157
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Exponents in scar?

    Do you know of any functions to find exponents in scar or how I could go about it? I was going to use logarithms but I don't think scar has natural log (ln) so I'm looking for another way.

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    function Log10(X: Extended): Extended;
    function Log2(X: Extended): Extended;
    function LogN(Base, X: Extended): Extended;
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    or just

    SCAR Code:
    Number := anumber * (anumber * exponent);

    You can use the above.

    Cut em2 it
    Formerly known as Cut em2 it

  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    There's also Pow(base, exponent);



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  5. #5
    Join Date
    Sep 2008
    Location
    New Zealand
    Posts
    157
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  6. #6
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    There's also Pow(base, exponent);
    That function it like, broken. Writeln(FloatToStr(Pow(16,43))) gave me 5.98631070650738E51. How can there be a e in a float!?!

  7. #7
    Join Date
    Sep 2008
    Location
    New Zealand
    Posts
    157
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Mylesmadness View Post
    That function it like, broken. Writeln(FloatToStr(Pow(16,43))) gave me 5.98631070650738E51. How can there be a e in a float!?!
    E means time 10 to the (whatever comes after it) so in this case it means 5.98 * 10^51... called standard notation look it up if you don't understand.

  8. #8
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cut em2 it View Post
    or just

    SCAR Code:
    Number := anumber * (anumber * exponent);

    You can use the above.

    Cut em2 it
    How would that work?

  9. #9
    Join Date
    Sep 2008
    Location
    New Zealand
    Posts
    157
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Timer View Post
    How would that work?
    Agreed that doesn't work, example 2^3:

    2 * (2 * 3) = 12 but 2^3 is 8.

  10. #10
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm.. try..

    SCAR Code:
    var
      Base, Exponent, I, O: Integer;

    begin
      Base := 2;//Number
      Exponent := 6;//To the what power?
      O := Base;//Sets O as the Number
      for I := 2 to Exponent do//For 2 to the Power.. NOT from one because you had to declare the variable...
        O := O * Base;//Multiplying
      WriteLn(IntToStr(O));//Writes the answer to the debug box...
    end.

    Hope i helped... Didn't even test it / nor see if it compiled.. xD

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 15
    Last Post: 09-22-2008, 12:32 PM
  2. SCAR Divi 3.01 DONT associate .scar files!!!
    By chimpy in forum News and General
    Replies: 1
    Last Post: 04-21-2007, 08:49 PM
  3. Replies: 28
    Last Post: 06-22-2006, 04:27 PM

Posting Permissions

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