#!/usr/bin/perl -w

print "Enter a number :";
$num = <STDIN>;

$h = $num+1;
$l = 0;
while ($h > $l + 0.000000001)
{
	$m = ($h + $l) / 2;
	$diff = $m**2-$num;
	print "L = $l M = $m H = $h Diff = $diff\n";
	$h = $m if ($diff > 0);
	$l = $m if ($diff < 0);
}
