How many digit after the comma a negative float variable can take


+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member yvesmazzon's Avatar
    Join Date
    Jul 2006
    Posts
    208
    Thumbs Up
    Received: 6
    Given: 32
    Total Downloaded
    10.75 GB

    0 Not allowed!

    Default How many digit after the comma a negative float variable can take

    Hello Picsters,

    How many digit after the comma a negative float variable can take or what precision?

    Regards,

    Yves

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    473
    Thumbs Up
    Received: 58
    Given: 0
    Total Downloaded
    330.54 MB

    0 Not allowed!

    Default Re: How many digit after the comma a negative float variable can take

    If you're talking about the decimal point position, it really doesn't matter much where it is until you start to approach the extreme end of the range (E+-38, or there abouts). You get 6-7 decimal digits total.

    Keep that in mind if you do operations with variables that cover a wide range (ie large number + small number).

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,760
    Thumbs Up
    Received: 77
    Given: 33
    Total Downloaded
    4.30 GB

    0 Not allowed!

    Default Re: How many digit after the comma a negative float variable can take

    Yves,
    The important thing to understand is Significant Figures.
    The accuracy of floating point maths available in PDS runs out after 6 or 7 significant figures.
    Look up "Rules for significant figures" in Google then choose the www.nku.edu option as a useful one.
    The tricky part is understanding when zero is significant or not.
    John
    Last edited by John Drew; 7th February 2019 at 02:02. Reason: Typo, my phone can't spell

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,341
    Thumbs Up
    Received: 289
    Given: 139
    Total Downloaded
    1.60 GB

    0 Not allowed!

    Default Re: How many digit after the comma a negative float variable can take

    That's one of the reasons I created 64-bit floating point in Proton24. I'm sure it was John, who was developing astronomical equipment and he wanted a bit more accuracy, so I decided to create the 64-bit floats. Because they operate on the 16-bit architecture of the PIC24 and dsPIC devices, they are very fast to operate and very accurate. In Proton24, they are named "Double"

    An 8-bit device is not suitable for 64-bit floating point IMO, because they take so much room up and are quite complex so will be quite slow on any 8-bit microcontroller platform.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,760
    Thumbs Up
    Received: 77
    Given: 33
    Total Downloaded
    4.30 GB

    0 Not allowed!

    Default Re: How many digit after the comma a negative float variable can take

    The 64 bit floats in Proton 24 work a treat and give great accuracy. The orbit of the moon is really complex and there are hundreds of lines of code so accuracy is critical. The moon is is one of the most difficult astronomical bodies to track. Because it's moving the calculations also need to be fast because1 sec updates are necessary. The P24 series are ideal with Les's double floats.
    John

    If any users make use of Floats I recommend reading this article in Microchip Developers:http://microchipdeveloper.com/c:unde...epresentations
    Last edited by John Drew; 8th February 2019 at 04:38.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Member yvesmazzon's Avatar
    Join Date
    Jul 2006
    Posts
    208
    Thumbs Up
    Received: 6
    Given: 32
    Total Downloaded
    10.75 GB

    0 Not allowed!

    Default Re: How many digit after the comma a negative float variable can take

    Thank you all

    Yves

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #7
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,352
    Thumbs Up
    Received: 78
    Given: 44
    Total Downloaded
    1.39 GB

    0 Not allowed!

    Default Re: How many digit after the comma a negative float variable can take

    For expected precision on today's larger and faster PICs see NBitMath for calculation values of up to 31 bytes wide with no rounding down etc.

    For display and step by step debugging see macroFORMAT which converts the up to 31 bytes wide values into a string.

    Norm

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

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

       

    Similar Threads

    1. Problem for Print or Float variable
      By SELCUK in forum Proton Plus Compiler v3
      Replies: 10
      Last Post: 31st May 2009, 19:07
    2. Float variable
      By Dave-S in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 11th September 2007, 23:43
    3. Float variable
      By Dave-S in forum Proton Plus Compiler v3
      Replies: 3
      Last Post: 11th June 2007, 12:40

    Members who have read this thread since 17th October 2019, 01:35 : 0

    Actions :  (Set Date)  (Clear Date)

    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