A characterization of real analytic functions