Hello!
I post a small extension for simple, but sometimes necessary calculations of the aspect ratio of a rectangle. To a greater extent, it is convenient to use it to calculate the aspect ratio of your game on the user’s screen. There are functions without parameters that immediately use window sizes or monitor extensions for calculations.
Settings:

Width
; 
Height
.
Functions:

Ratio
(String Expression)  ratio value in the format “ratio_w, ratio_h”; 
RatioWidth
(Expression)  value of the ratio for the width of the rectangle; 
RatioHeight
(Expression)  value of the ratio for the height of the rectangle; 
RatioGreatestCommonDivisor
(Expression)  the value of the greatest common divisor for the sides; 
RatioSceneWindow
(String Expression, no parameters)  value of the ratio in the format “ratio_w, ratio_h” for the size of the game window; 
RatioScreen
(String Expression, no parameters)  the ratio value in the “ratio_w, ratio_h” format for expanding the monitor window.
For example, you will get the following results:
(1600, 900) = 16, 9;
(1440, 900) = 8, 5;
(1366, 768) = 683, 384;
(1280, 1024) = 5, 4;
(1280, 720) = 16, 9;
(1024, 768) = 4, 3.
The calculations themselves are simple:
// The binary Greatest Common Divisor calculator
var gcd = function (u, v) {
if (u === v) return u;
if (u === 0) return v;
if (v === 0) return u;
if (~u & 1)
if (v & 1)
return gcd(u >> 1, v);
else
return gcd(u >> 1, v >> 1) << 1;
if (~v & 1) return gcd(u, v >> 1);
if (u > v) return gcd((u  v) >> 1, v);
return gcd((v  u) >> 1, u);
}
// Find the greatest divisor
var d = gcd(arg_width, arg_height);
// Result
Result = ([arg_width / d, arg_height / d]);
File extension: AspectRatio.json