Mathematical problem


Closed Thread
Results 1 to 3 of 3
  1. #1

    Question Mathematical problem

    Hi all, I want to ask if there are any mathematical operator or command can find the power of any number for example i want to find (2^7) which is equal 128 ?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by iugmoh View Post
    Hi all, I want to ask if there are any mathematical operator or command can find the power of any number for example i want to find (2^7) which is equal 128 ?
    Not as such, at least not the way you want it...but this works too...

    Result var Long
    t1 var long '2 in the above example
    t2 var long '7 in the above example
    t3 var long 'counter

    result = t1 : for t3 = 1 to ( t2 - 1 ) : result = result * t1 ) : next t3

    I'd bet good money that DT has a macro already made for just this sort of thing...

  3. #3


    Did you find this post helpful? Yes | No

    Thumbs up

    thank you for your help

Similar Threads

  1. problem using GOSUB under interrupt
    By fobya71 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 5th March 2010, 19:52
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  3. PicBasic Pro Math Problem??
    By Glen65 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th March 2006, 04:36
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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