commit bash-20130301 snapshot

This commit is contained in:
Chet Ramey
2013-03-26 20:51:22 -04:00
parent 8eb22ee966
commit c7e43312f9
220 changed files with 45368 additions and 801 deletions
+21
View File
@@ -0,0 +1,21 @@
#From: Syamala Rao Tadigadapa <stadigad@us.oracle.com>
#Subject: Re: Division in ksh(getting the exact number) Please HELP
#Date: Mon, 25 Oct 1999 15:05:08 -0700
#Message-ID: <3814D414.7B896084@us.oracle.com>
#Here is how to calculate the (integer part of the) square root
#of a number in a much cleaner way.
sqroot()
{
let arg=$1
let root=arg
while :
do
newroot=$(( (root+arg/root)/2 ))
(( newroot == root )) && { echo $root; return; }
let root=newroot
done
}
sqroot "$@"