Skip to content

Instantly share code, notes, and snippets.

@complex857
Created March 26, 2011 10:04
Show Gist options
  • Save complex857/888178 to your computer and use it in GitHub Desktop.
Save complex857/888178 to your computer and use it in GitHub Desktop.
dcl sqrt for vms \o/
$ if P1 .eqs. "MAIL"
$ then
$ mail 'f$env("procedure")' MAULIS /subject="VMS BEADANDO 3"
$ goto legvege
$ endif
$ base = p1 * 1000000
$ last = 0
$ cur = 999 !gyok1hez
$ mul_loop:
$ cur = cur+1
$ m = cur * cur
$ if base .gt. m
$ then
$ last=m
$ goto mul_loop
$ else
$ goto mul_loop_end
$ endif
$ mul_loop_end:
$ if m-base .gt. base-last
$ then
$ cur = cur-1
$ endif
$ s = f$str(cur)
$ h = f$length(cur)-2
$ say f$extr(0,1,s)+"."+f$extr(1,h,s)
$ legvege:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment