Skip to content

SkynetNext/fixed64

Repository files navigation

Fixed64: A High-Performance, Cross-Platform Fixed-Point Arithmetic Library

Overview

Fixed64 is a fixed-point arithmetic library delivering high computational efficiency and consistency across platforms. Built on int64_t, it enables precise, deterministic mathematical operations ideal for applications requiring consistent results in various environments.

Key Features

  • High Performance: 3-5x faster than the original C# implementation
  • Cross-Platform Consistency: Bit-exact results across different platforms
  • Comprehensive Math Support: Full range of arithmetic, trigonometric, and mathematical functions
  • Template-Based Precision: Choose between range and precision with different bit configurations
  • Header-Only: Easy integration with no linking required

Quick Start

#include "fixed64.h"

using math::fp::Fixed64<32>;  // 32-bit fractional precision

int main() {
    Fixed64<32> a(5.5);
    Fixed64<32> b(2.25);
    
    Fixed64<32> sum = a + b;        // 7.75
    Fixed64<32> product = a * b;    // 12.375
    
    std::cout << "Result: " << sum << std::endl;
    return 0;
}

Documentation

  • Features - Detailed feature descriptions
  • Examples - Usage examples and code snippets
  • Performance - Performance benchmarks and analysis

System Requirements

  • C++20 or later (uses std::bit_cast)
  • Tested with: Clang 10.0+, GCC 10.0+

About

a C++ library leveraging int64 for efficient fixed-point arithmetic. It guarantees consistent float/double conversions across various platforms, outperforming existing solutions in precision and reliability.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors