Iconoclast
New member
I have decided to give up bypassing the use of the modulo function, while some conversions were of success. Instead, I have used tolerance of the function to make an engine that takes two integers the user enters and returns the greatest common factor (or GCF) of the two integers. This is one of my tougher experiments that took a lot of (tens of hours of) sitting down and writing numbers, especially the goddamn debugging.
An integer is a number with all decimal places past the decimal point 0. 72.00000... (72) is an integer. 72.0185 is not an integer. Keep in mind that this engine will only support integers. A factor is an integer that goes into another integer an integer amount of times.
Factors of 24 are: 1, 2, 3, 4, 6, 8, 12 and 24.
Factors of 32 are: 1, 2, 4, 8, 16, and 32.
The greatest common factor of these two integers therefore is 8. I have attached my current progress of the engine as an uncompressed zip archive.
One last thing. You can use this to return the aspect ratio of a resolution. Try 640 and 480. Once you enter these into the program, not only will the GCF be returned, but both these numbers will be divided by the GCF (160) to return the simplified ratio of 4:3.
An integer is a number with all decimal places past the decimal point 0. 72.00000... (72) is an integer. 72.0185 is not an integer. Keep in mind that this engine will only support integers. A factor is an integer that goes into another integer an integer amount of times.
Factors of 24 are: 1, 2, 3, 4, 6, 8, 12 and 24.
Factors of 32 are: 1, 2, 4, 8, 16, and 32.
The greatest common factor of these two integers therefore is 8. I have attached my current progress of the engine as an uncompressed zip archive.
One last thing. You can use this to return the aspect ratio of a resolution. Try 640 and 480. Once you enter these into the program, not only will the GCF be returned, but both these numbers will be divided by the GCF (160) to return the simplified ratio of 4:3.