home *** CD-ROM | disk | FTP | other *** search
/ Dos/V Magazine 2002 July 1 / VMAG130101.iso / ONLINE / monthly / calc / CLPCA511.LZH / ClipCalc / EXTFUNC / hypot2.cef < prev    next >
Encoding:
Text File  |  2002-08-18  |  316 b   |  13 lines

  1. #!/usr/local/bin/clip
  2. #Æ╝èpÄOèpî`é╠Ä╬ò╙é╠Æ╖é│(Moler\-Morrison û@) hypotenuse
  3. #\!- <val> <val>
  4. :float \16
  5. @x = abs @0; @y = abs @1
  6. if @x < @y; @t = @x; @x = @y; @y = @t; endif
  7. if @y == 0; return @x; endif
  8. for @i = 0; @i < 3; @i++
  9.     @t = @y / @x; @t *= @t; @t /= 4 + @t
  10.     @x += 2 * @x * @t; @y *= @t
  11. next
  12. @x
  13.