The Distance to L ∞ in some Function Spaces and Applications