Avoid error comes from floating point literal decimal representation in code generation
Opened this issue · 5 comments
Conversion between floating point value ↔ decimal string representation cause some small error.
Several solution exists:
- Using hexadecimal representation (But not allowed in C++14 standard)
- Embedding as array of binary value and using
memcpy
I think that second solution may be more preferred.
I would like to know more about the second solution to prevent misunderstanding.
Do you intend to create a new binary file and load data from the file? Or do you intend to generate arrays like the one generated by the xxd -i
command (an array of unsigned char that can be converted to an array of float or int with reinterpret_cast
) and embed it in the source code?
It looks that the latter approch is better to me, because the amount of changes is likely less than the former.
I supposed to embed data in the source code.
I see. I agree to your idea.
Are you already working on this issue? If you haven't, would you mind if I worked on it?
No, I haven't started yet.
OK, I'll try.