{"repo":"robaho/fixed","free":true,"listed":false,"github":"https://github.com/robaho/fixed","clone":"git clone https://github.com/robaho/fixed.git","description":"high performance fixed decimal place math library for Go","language":"Go","stars":352,"topics":["golang","financial","math","fixed-point","performance"],"license":"MIT","category":"trading","readme_excerpt":"Summary A fixed place numeric library designed for performance. The C++ version is available here. All numbers have a fixed 7 decimal places (18 digits total), and the maximum permitted value is +- 99999999999, or just under 100 billion. NaN is supported. The library is safe for concurrent use. Fixed values are immutable. It has built-in support for binary and json marshalling. It is ideally suited for high performance trading financial systems. All common math operations are completed with 0 allocs. Design Goals Primarily developed to improve performance in go-trader. Using Fixed rather than decimal.Decimal improves the performance by over 20%, and a lot less GC activity as well. You can review these changes under the 'fixed' branch. If you review the go-trader code, you will quickly see that I use dot imports for the fixed and common packages. Since this is a \"business/user\" app and not systems code, this provides 2 major benefits: less verbose code, and I can easily change the implementation of Fixed without changing lots of LOC - just the import statement, and some of the wrapper methods in common. The fixed.Fixed API uses NaN for reporting errors in the common case, since often code is chained like: and this would be a huge pain with error handling. Since all operations involving a NaN result in a NaN, any errors quickly surface anyway. Performance using Go 1.21.5 cpu: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz BenchmarkAddFixed-8 1000000000 0.9627 ns/op 0 B/op 0 allocs/op","default_branch":null,"files":null,"tree":[],"storefront":"/r/robaho","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/robaho/fixed/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}