#!/usr/bin/env php
<?php
if(! isset($argv[1]) || ! is_numeric($argv[1]) || intval($argv[1]) <= 0){
printf("Usage: %s nbr_int
nbr_int: Un nombre entier supérieur à 0\n", $argv[0]);
exit(1);
}
$nbr_int = intval($argv[1]);
$a = 0;
$b = 1;
while ($b < $nbr_int) {
printf("%d\n", $b);
$b = $a + $b;
$a = $b - $a;
}
printf("b/a = %1.15f\n", $b/$a);
exit(0);