If you want to have logic working in all places, you write an environment dependent wrapper and use that wrapper. Normalizing to a decent range (resolution - number of significant digits - desired 'accuracy') is always a good approach. And, if you have the issue to only be able to deal with integers 1 up to 4 bytes - pos only or neg and positive - convert (scale and offset) to desired range (always knowing how to properly interpret the 'new' value).
© Espruino, powered by microcosm.
Report a problem