File: const_ex.ml

package info (click to toggle)
ocamlgsl 1.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,296 kB
  • sloc: ml: 8,523; ansic: 6,755; makefile: 29
file content (13 lines) | stat: -rw-r--r-- 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
open Gsl

let () =
  let au = Const.MKSA.astronomical_unit in
  let c = Const.MKSA.speed_of_light in
  let min = Const.MKSA.minute in

  let r_earth = 1.00 *. au in
  let r_mars = 1.52 *. au in

  Printf.printf "light travel time from Earth to Mars:\n";
  Printf.printf "minimum = %.1f minutes\n" ((r_mars -. r_earth) /. c /. min);
  Printf.printf "maximum = %.1f minutes\n" ((r_mars +. r_earth) /. c /. min)