[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #23368 [Core Tor/Tor]: Add design and coding guidelines for using floating point
#23368: Add design and coding guidelines for using floating point
-----------------------------+------------------------------------
Reporter: teor | Owner: (none)
Type: enhancement | Status: needs_review
Priority: Medium | Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: doc, tor-safety | Actual Points:
Parent ID: | Points: 0.5
Reviewer: | Sponsor:
-----------------------------+------------------------------------
Comment (by teor):
4. Try to do as many of your calculations in integer precision as
possible, and convert to floating point for display or transfer.
It might also help to link to a general list of do's and don't's, like:
* don't compare floating-point numbers using equals (comparing with 0.0 is
an exception)
* always check for division by zero, even if the inputs to a function are
non-zero, the result can round to zero
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23368#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs