Math problem with PBP 2.6 and 18F4550, large numbers


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262

    Default Math problem with PBP 2.6 and 18F4550, large numbers

    hey everyone, ive been reading up on the multiply and divide funtions of PBP, not sure I understand this, it states that when it multiplys it actually does it as a 32bit number and spits it into two parts, not sure how this will help me. I need to multiply this set of numbers below, This is my max numbers.

    Code:
    A=20000
    B=20000
    C=A*B '400,000,000 (much larger than 65536)
    D=C/1000 '400,000 (still too large)
     Lcdout "Output=",Dec (D / 1000), ".", Dec3 (D // 1000) ' Displays (Output=400.000)
    
    I know PBP3 has the long funtion, but hey I dont have PBP and wont be getting it soon.
    So if anyone can help me with this....

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Math problem with PBP 2.6 and 18F4550, large numbers

    Sounds like you need some big integer library integer functions. I only know of one of these written in a basic dialect. But there may be one that already exists for PBP?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Math problem with PBP 2.6 and 18F4550, large numbers

    The PBPL compiler (with LONG vars) was introduced in version 2.50 ... so you already have it.

    In MicroCode Studio, go to View > Compile and Program options > Compiler tab, and check the "Use PBPL" checkbox.
    DT

  4. #4
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: Math problem with PBP 2.6 and 18F4550, large numbers

    Ah thank you thank you thank you....

    actually i had to reinstall PBP 2.6, i had a backup on the pc of 2.46, and one of the kids deleted the compiler for 2.6 and went back to the 2.46, so i reinstalled, and checked that option.
    i havent tryed the math but it let me assign a 40000000 number to the VAR so it should work.

Similar Threads

  1. handling Large Numbers
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th April 2007, 03:33
  2. store/display very large numbers (700000)
    By ttease in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th March 2007, 23:08
  3. Multiplying large numbers
    By jhonea1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 14th April 2006, 18:41
  4. How to display large numbers
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th March 2006, 00:17
  5. math problems - large numbers
    By Tomasm in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th February 2004, 08:48

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