2
There is a function for java, equivalent to map() of c++?
Basically it calculates the ratio between the values "minimum" and "maximum".
2
There is a function for java, equivalent to map() of c++?
Basically it calculates the ratio between the values "minimum" and "maximum".
3
Apparently, there is no such standard function in Java, and probably not even in C++, but only in the Arduino for the conversion of sensor values.
You can implement it in your project because it’s very simple, and the code is in the link you posted:
long map(long x, long in_min, long in_max, long out_min, long out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
Browser other questions tagged java c++
You are not signed in. Login or sign up in order to post.
It’s true @George had not read the right post. Thank you very much friend.
– Emerson Barcellos
@Emersonbarcellos, no problem. It’s an important question for the community, having a native function would be much simpler!
– George