Created
March 26, 2011 10:04
-
-
Save complex857/888178 to your computer and use it in GitHub Desktop.
dcl sqrt for vms \o/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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