Q:

What does the phrase "to within" mean?

While I was reading the book 'Introduction to Algorithms by CLRS', I came across the sentence: 

...is equal to g(n) to within a constant factor.

I've seen something about it in Merriam-Webster, but 'to within' is not clear to me, as I am not a native English speaker. 
Can anyone explain it to me? 

A:

Perhaps a non-math illustration will help clarify the meaning of "to within." 
"The bullet penetrated his abdomen to within 1 cm of his spine." It describes that the bullet penetrated the abdomen and came to rest 1 cm or less distance from the spine.
"The home-made rocket climbed to within 5 miles of the stratosphere." This means the rocket climbed from the surface of the earth up to an altitude that is 5 miles from the stratosphere, up to but not including the stratosphere. So we don't know exactly how high the rocket went but its somewhere "within" that range.

