Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of reScale by
Revision 2:457c3e6a7c13, committed 2018-08-31
- Comitter:
- Marcelocostanzo
- Date:
- Fri Aug 31 13:33:50 2018 +0000
- Parent:
- 1:ebb951147122
- Commit message:
- Funcionando, FInal
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 457c3e6a7c13 reScale.cpp
--- a/reScale.cpp Mon Mar 03 19:57:45 2014 +0000
+++ b/reScale.cpp Fri Aug 31 13:33:50 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 457c3e6a7c13 reScale.h
--- a/reScale.h Mon Mar 03 19:57:45 2014 +0000
+++ b/reScale.h Fri Aug 31 13:33:50 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
