An approximation technique for real-valued functions☆