arturbac / fixed_math

FixedMath: A High-Performance C++23, C++17 Library for Fixed-Point 48.16 Arithmetic
https://arturbac.github.io/fixed_math/
Boost Software License 1.0
67 stars 4 forks source link

[BUG] fix compilation error in example code on README.md #3

Closed toge closed 3 months ago

toge commented 3 months ago

Describe the bug There is an compilation error in example code on README.md. https://github.com/toge/fixed_math/tree/master?tab=readme-ov-file#example

Error Message is following:

test_package.cpp:32:31: error: unable to find numeric literal operator ‘operator""_fix’
   32 |     some_fixed = some_float * 2.45_fix; //operation with float is promoted to fixed_t
      |                               ^~~~~~~~

It is lack of using fixedmath::operator ""_fix; or using namespace fixedmath;. Not sure which is more appropriate for the fixed_math coding style. Could you please fix it?

Build info:

arturbac commented 3 months ago

sure I'll create (ASAP) example.cc in fixedmath

mentioned operator is here

readme example is missing

using fixedmath::operator ""_fix;
toge commented 3 months ago

@arturbac Thanks!