c - Floating point emulation or Fixed Point for numbers in a given range -


i have co-processor not have floating point support. tried use 32 bit fix point, unable work on small numbers. numbers range 1 1e-18. 1 way use floating point emulation, slow. can make faster in case know numbers won't greater 1 , smaller 1e-18. or there way make fix point work on small numbers.

it not possible 32-bit fixed-point encoding represent numbers 10–18 1. obvious fact span 10-18 ratio of 1018, non-zero encodings of 32-bit integer span ratio of less 232, less 1018. therefore, no choice of scale fixed-point encoding provide desired span.

so 32-bit fixed-point encoding not work, , must use other technique.

in applications, may suitable use multiple fixed-point encodings. is, various input values encoded fixed-point encoding each scale suitable it, , intermediate values , outputs have customized scales. obviously, possible if suitable scales can determined @ design time. otherwise, should abandon 32-bit fixed-point encodings , consider alternatives.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -