TITLE: Scale Conversion/ Range conversion
QUESTION [0 upvotes]: I have a sensor system that receives range of values(example is given below). 
These range values need to be mapped to integer values. 
Value Range....... ...Integer
0.000 to 0.049 ----->   0
0.050 to 0.099 ----->   1 
0.010 to 0.149 ----->   2 
.....    .....        ..goes on like this
I need to find the  mathematical expression so that whenever the value comes the expression convert it to integer values. It would be great if someone can help me with this.
Thanks in advance.

REPLY [1 votes]: $f(x)=\lceil 20x-0.98 \rceil$ seems to do the trick.
{"set_name": "stack_exchange", "score": 0, "question_id": 2102313}