Warming-up is a sequence of exercise that precedes your gym workout.
If you are performing a sport or workout that is aerobic, your warm-up should prepare your cardiovascular system for the rigours of this workout or event. The warm-up should be designed to raise the body’s core temperature and be performed at a low intensity – it is not a workout in itself!
Likewise, when lifting weights, your warm-up should be relevant. You should perform warm-up sets of any exercise you are to perform. Typically, I would suggest 2 to 4 warm-up sets (starting with a very light weight) of each exercise before undertaking working sets of that same exercise. Warm-up sets will serve to locally heat the muscles in use and help to lubricate relevant joints in readiness.
For a gym workout that relates to both disciplines, such as an endurance gym workout routine with weights, I would be inclined to suggest an aerobic warm-up followed by warm-up sets, although you may warrant less warm-ups sets.
As per most subjects, warming-up is open to debate on which methods are best. As always, I would suggest adapting things to the individual and their endeavor. It should be remembered that the purpose of warming-up is to help improve performance and avoid injury.
[Extracted from: http://www.gymprofessor.com/warm-up.html]