long to float variables
Fork of reScale by
Revision 2:1715e312322b, committed 2018-05-16
- Comitter:
- Marcelocostanzo
- Date:
- Wed May 16 19:48:12 2018 +0000
- Parent:
- 1:ebb951147122
- Commit message:
- funcionando
Changed in this revision
reScale.cpp | Show annotated file Show diff for this revision Revisions of this file |
reScale.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ebb951147122 -r 1715e312322b reScale.cpp --- a/reScale.cpp Mon Mar 03 19:57:45 2014 +0000 +++ b/reScale.cpp Wed May 16 19:48:12 2018 +0000 @@ -1,12 +1,12 @@ #include "reScale.h" -reScale::reScale(long in_min, long in_max, long out_min, long out_max) : +reScale::reScale(float in_min, float in_max, float out_min, float out_max) : _inMin (in_min),_inMax(in_max),_outMin (out_min),_outMax (out_max) { } -long reScale::from(long value) +float reScale::from(float value) { return (value - _inMin) * (_outMax - _outMin) / (_inMax - _inMin) + _outMin; }
diff -r ebb951147122 -r 1715e312322b reScale.h --- a/reScale.h Mon Mar 03 19:57:45 2014 +0000 +++ b/reScale.h Wed May 16 19:48:12 2018 +0000 @@ -2,9 +2,9 @@ class reScale { public: -reScale(long in_min, long in_max, long out_min, long out_max); +reScale(float in_min, float in_max, float out_min, float out_max); -long from(long value); +float from(float value); protected: -long _inMin ,_inMax ,_outMin ,_outMax ; +float _inMin ,_inMax ,_outMin ,_outMax ; }; \ No newline at end of file