playdate
playdate copied to clipboard
Floating point math operations optimisation
Explicitly set floating point single precision for compiler.
The Cortex-M7 processor used in the Playdate has support for single precision floating point operations (ie. the
float
type), but not for double precision operations (ie. thedouble
type).Some compiler flags can be used to make these mistakes obvious or easier to deal with:
-Wdouble-promotion
: Warns whenever afloat
is implicitly being converted to double.-fsingle-precision-constant
: All real constants will befloat
rather thandouble
, ie.1.0
will be the same as1.0f
.
- [ ] implementation
- [ ] tests for bins
- [ ] tests for libs