fork(1) download
  1. var aspect_ratio = 17.0 / 7.0;
  2. var image_width = 400;
  3.  
  4. var image_height = Math.trunc(image_width / aspect_ratio);
  5.  
  6. var viewport_height = 2;
  7. var viewport_width = viewport_height * image_width / image_height;
  8.  
  9. print("Aspect ratio:", aspect_ratio);
  10. print("Image:", image_width, "x", image_height);
  11. print("Viewport:", viewport_width, "x", viewport_height);
Success #stdin #stdout 0.38s 39192KB
stdin
Standard input is empty
stdout
Aspect ratio: 2.4285714285714284
Image: 400 x 164
Viewport: 4.878048780487805 x 2