number input vs range slider

what are the advantages and disadvantages of range slider type input as compared with the classical number input? When it is better to use them?