After decrypting an affine cypher I was left with the inverse encoder of withibeing the particular letter of the alphabet with up to

Take S for example, which decodes to Y, but

My work around.

I don't know how to change decimals into a mod whole number. My get around was to keep adding 26 toiuntil I got a number ending in 2 or 7 so i could take 2 and divide by 5 and keep in the integers. Obviously this is a rather long winded way of doing it and it is using my inteligence rather than a algorithm a computer can do. I assume there must be a proper way of doing it but I can't find any info on it.

Thank you.