Working Out Screen Ratio

Hello there,
So I am currently working on a “landing page” for my server, the issue is that people have different screen sizes and I don’t want it to be stretched. Most people (to my knowledge) will use a repeating texture to deal with this as there are no chances of this being stretched. The only thing I can come up with is not efficient what so ever, which will basicly go though LOADS of numbers till it gets a ratio which the image supports. Is there a way I can maybe do a “IsFactor()” or “IsRatio”.

If you can offer any advice or help, please respond.

This is an example of a repeating pattern.

Edit:
The Ratio must be in its simplest form

Ratio is Width/Height, so what about if you compare if it’s 16/9 or 4/3

I was being stupid.
Here is the Code though for other people who are having trouble



function GetScreenRatio()
      local h, w = ScrH(),ScrW()
      if (h * (4 / 3)) == w then
         return 1
      elseif h * (16 / 9) == w then
         return 2
      elseif h * (16 / 10) == w then
         return 3
      else
         return false
      end
end


This works, I am returning numbers simply to get the position of the material in a table. Thanks for the help though