{"id":26272289,"url":"https://github.com/digitalinblue/cppcon2015","last_synced_at":"2025-06-21T06:41:32.088Z","repository":{"id":151355968,"uuid":"42753870","full_name":"DigitalInBlue/CPPCon2015","owner":"DigitalInBlue","description":"Slides and Source Code from \"Demystifying Floating Point Numbers\" given at CPPCon 2015.","archived":false,"fork":false,"pushed_at":"2015-09-24T02:12:24.000Z","size":2356,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-05T16:55:10.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DigitalInBlue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-19T00:56:45.000Z","updated_at":"2024-11-25T21:51:17.000Z","dependencies_parsed_at":"2023-04-08T06:47:15.312Z","dependency_job_id":null,"html_url":"https://github.com/DigitalInBlue/CPPCon2015","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DigitalInBlue/CPPCon2015","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalInBlue%2FCPPCon2015","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalInBlue%2FCPPCon2015/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalInBlue%2FCPPCon2015/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalInBlue%2FCPPCon2015/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalInBlue","download_url":"https://codeload.github.com/DigitalInBlue/CPPCon2015/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalInBlue%2FCPPCon2015/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261080113,"owners_count":23106564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-14T07:18:03.533Z","updated_at":"2025-06-21T06:41:27.073Z","avatar_url":"https://github.com/DigitalInBlue.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Demystifying Floating Point\nJohn Farrier, CPPCon 2015\n\nSlides and Source Code from \"Demystifying Floating Point Numbers\" given at CPPCon 2015.\n\n##Notes\n* IEEE Single Format - 1 sign, 8 exponent, 23 fraction\n* IEEE Double Format - 1 sign, 11 exponent, 52 fraction\n* Has several rounding options (Java only permits \"Round to Nearest\")\n* Do not test for equality\n* Order of operations matters\n* The relative magnitudes of numbers involved in a computataion matters\n* Prefer to multiply, add, and subtract - divide only when necessary\n* Avoid elementary functions i.e. logarithmic, exponential, trigonometric, hyperbolic\n\n##General Online References\n* [A Logarithm Too Clever by Half](https://www.cs.berkeley.edu/~wkahan/LOG10HAF.TXT)\n* [Anatomy of a floating point number](http://www.johndcook.com/blog/2009/04/06/anatomy-of-a-floating-point-number/)\n* [Comparing Floating Point Numbers](http://www.cygnus-software.com/papers/comparingfloats/Comparing%20floating%20point%20numbers.htm)\n* [Demystifying Floating Point](http://dlang.org/d-floating-point.html)\n* [Don't Store That in a Float](https://randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float/)\n* [Five Tips for Floating Point Programming](http://www.codeproject.com/Articles/29637/Five-Tips-for-Floating-Point-Programming)\n* [Floating Point Comparison](http://floating-point-gui.de/errors/comparison/)\n* [Floating Point Determinisim](http://www.gamedev.net/topic/499435-floating-point-determinism/)\n* [Floating point number representation](http://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html)\n* [Floating Point Operations and Streaming SIMD Extensions](https://www.cs.fsu.edu/~engelen/courses/HPC-adv/FP.pdf)\n* [Floating Point Representation](http://pages.cs.wisc.edu/~markhill/cs354/Fall2008/notes/flpt.apprec.html)\n* [Floating Point](http://www.tfinley.net/notes/cps104/floating.html)\n* [IEEE 754 Converter](http://www.h-schmidt.net/FloatConverter/IEEE754.html)\n* [IEEE floating-point exceptions in C++](http://www.johndcook.com/blog/ieee_exceptions_in_cpp/)\n* [Is floating  point math deterministic?](http://blogs.msdn.com/b/shawnhar/archive/2009/03/25/is-floating-point-math-deterministic.aspx)\n* [Is Your Model Susceptible to Floating-Point Errors?](http://jasss.soc.surrey.ac.uk/9/4/4.html)\n* [Lecture Notes on the Status of IEEE 754, Kahan, October 1, 1997](http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF)\n* [Mathematics in Video Games](http://www.gamasutra.com/view/feature/131605/mathematics_in_videogames.php)\n* [Miscalculating Area and Angles of a Needle-like Triangle](https://www.cs.berkeley.edu/~wkahan/Triangle.pdf)\n* [Visualizing Floats](http://www.gamasutra.com/view/feature/1965/visualizing_floats.php?print=1)\n* [We Really Don't Know How To Compute!](http://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute)\n* [What Every Computer Scientist Should Know About Floating-Point Arithmetic](http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)\n\n##General Offline References\n* Hacker's Delight, (Warren)\n* Handbook of Floating-Point Arithmetic (Muller, Brisebarre)\n* Numerical Computing with IEEE Floating Point Arithmetic (Overton)\n\n##Compiler Specific Information\n###Visual Studio\n[Microsoft Visual C++ Floating-Point Optimization](https://msdn.microsoft.com/library/aa289157.aspx)\nhttps://msdn.microsoft.com/library/aa289157.aspx\n\n####Compiler Flags\n* /fp:[precise | except[-] | fast | strict ]\n\n####Pragmas\n* float_control( value,setting [push] | push | pop )\n* fenv_access [ON | OFF]\n* fp_contract [ON | OFF]\n\n\n###GCC\n[Math_Optimization_Flags](https://gcc.gnu.org/wiki/Math_Optimization_Flags)\n[Semantics of Floating Point Math in GCC](https://gcc.gnu.org/wiki/FloatingPointMath)\nhttps://gcc.gnu.org/wiki/FloatingPointMath\nhttps://gcc.gnu.org/wiki/Math_Optimization_Flags\n\n####Compiler Flags\n* -ffinite-math-only\n* -fno-rounding-math\n* -fno-signaling-nans\n* -fno-signed-zeros\n* -fnotrapping-math\n* -frounding-math\n* -fsignaling-nans\n* -funsafe-math-optimizations\n* -funsafe-math-optimizations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalinblue%2Fcppcon2015","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalinblue%2Fcppcon2015","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalinblue%2Fcppcon2015/lists"}