floting point variables?????


Closed Thread
Results 1 to 3 of 3
  1. #1
    kasapo's Avatar
    kasapo Guest

    Question floting point variables?????

    hi,

    do you know the size of aint and bint which are used in fp ? word, byte??


    aint = 30000
    Gosub itofa ' Convert int to float

    bint = 2045
    Gosub itofb ' Convert int to float

    Gosub fpmul ' FP multiply
    gosub ftoia /' here we get a 24 bit result

    when we convert it we get aint and how can we use it in the rest of the program ? can we equate it to 2 words ?

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


    Did you find this post helpful? Yes | No

    Default

    The aint variable is WORD sized. To get a larger number back from FP routines. Divide the result by 65536 to get the High Word. This is done before converting to an integer.

    HTH,
       Darrel

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


    Did you find this post helpful? Yes | No

    Default

    I should probably mention that if you're using the 24bit FP routines, then it's really only 16bit with an 8bit mantisa. To do what you had originally stated in the other thread, you should be using the 32bit version of the FP routines.

    Darrel

Similar Threads

  1. Max Variables
    By shawn in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th January 2008, 04:05
  2. Floating Point Display Problem (serial string out)
    By Cash Olsen in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th December 2007, 02:03
  3. Variables not appearing in Watch Window MPLabv7.3
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2006, 14:36
  4. How to tell which PICs can handle 16 bit variables?
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st August 2005, 08:44
  5. Problems with variables
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2004, 18:37

Members who have read this thread : 0

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