Write a function/subroutine/... that takes two ranges and a real number, and returns the mapping of the real number from the first to the second range.
Use this function to map values from the range <big><code> [0, 10] </code></big> to the range <big><code> [-1, 0]. </code></big>
;Extra credit:
Show additional idiomatic ways of performing the mapping, using tools available to the language.