Replies: 2 comments 3 replies
-
Templates offer flexibility, but at the cost of making APIs (and compiler warnings) so much more difficult to deal with. I definitely fell out of love with them some time ago. I really like the idea of typedefing via conditional compilation:
I can work on this, because I'll need to add this to the unit testing also (hopefully all the standard lib function overloads will handle floats OK). I should have something by the weekend... |
Beta Was this translation helpful? Give feedback.
-
This is available in the latest build now. Define Let me know if this is a good solution for your environment and I'll mention that as a recommendation for embedded systems in the manual. |
Beta Was this translation helpful? Give feedback.
-
I will be using tinyexpr-plusplus in an embedded solution on a ARM Cortex M0+ (RP2040) Microcontroller without hardware FPU, and I imagine using
float
rather thandouble
internally intinyexpr-plusplus
would provide quite a bit of a performance improvement.What would be the best way to make
tinyexpr-plusplus
usefloat
rather thandouble
as the internal (and external) data type?As I see it, there are two workable paths for such a change
typedef
template
argument in the te classesWhile using a
template
argument would be the most "pure" C++ solution, usingtypedef
would likely be the least invasive – and most backward compatible – approach.If I go ahead and ...
double
withte_type
/T
excercise... would there be any chance to have this change accepted as a pull request back into
tinyexpr-plusplus
so I dont have to keep tracking upstream changes and make similar type-changes to any new code?Beta Was this translation helpful? Give feedback.
All reactions