powered by
Note we always try the destination first, as that is the optimal shrink.
shrink.towards(destination)
the value we want to shrink towards.
# NOT RUN { shrink.towards (0) (100) # [0,50,75,88,94,97,99] shrink.towards(500)(1000) # [500,750,875,938,969,985,993,997,999] shrink.towards (-50) (-26) # [-50,-38,-32,-29,-27] # }
Run the code above in your browser using DataLab