From Wiring

< Map
Jump to: navigation, search
This page is intended as a reference for core developers only, and the content is only changed after a consensus has been reached through discussion of any such changes. Please use the Discussion page to talk about any changes or issues you have with the current implementation.
Classification Math Methods
Suggested location WMath.h
C++ required No
Timing constraints None
Version introduced 1.0 (0100)
Framework dependencies None
map(int32_t x,
int32_t in_min,
int32_t in_max,
int32_t out_min,
int32_t out_max)
Required? Yes
Issues None



Re-maps a number from one range to another.

Black Box Input

The number, the original range and the target range are provided.

Black Box Output

A float mapped in the target range is returned.


None. Single signature only.


Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful.

Proposed Changes

Personal tools