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

• # Thread: How many digit after the comma a negative float variable can take – 229 days old

1. 0

## 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

2. 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. 0

## 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).

4. 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. 0

## 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

6. 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. 0

## 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.

8. 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.

9. 0

## 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

10. 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.

11. 0

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

Thank you all

Yves

12. 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.

13. 0

## 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

14. 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)

#### Members who have read this thread since 10th September 2019, 22:06 : 0

Actions :  (Set 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