The Snellen acuity tests measures visual acuity normalized at a distance of 20 feet.
So someone with 20/40 vision sees at 20 feet the level of detail that a person with 20/20 vision sees at 40 feet.
So you simply need to translate this into ratios.
If, at 20 feet, a person with normal vision can make out a Snellen glyph $n$ inches tall, then a person with 20/40 vision requires the same glyph to be $2n$ inches tall. Alternatively, the person with 20/40 vision needs to be 10 feet away to see the $n$ inch Snellen glyph.
In other words, the Snellen denominator is linear.
Vision testing is done at standardized lengths, and we change the size of the glyphs.
There is a baseline accuracy typically used to assess visual acuity (usually like 80% of a "line").
Assume Alice has 20/20 vision, and she can read 80% of the glyphs that are 3" high from 20 feet.
If Bob can read 80% of the glyphs that are 4" high at 20 feet, but less than 80% of the glyphs that are 3" high, then his minimum visual angle for glyph discrimination is 4" divided by 20'. This means that his Snellen denominator is 33% higher than Alice's, so he has 20/(4/3*20) vision, or approximately, 20/27 vision.