Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. long square_root(long x) {
  2. in {
  3. assert(x >= 0);
  4. }
  5. out (result) {
  6. assert((result * result) <= x && (result+1) * (result+1) >= x);
  7. }
  8. body {
  9. return cast(long)std.math.sqrt(cast(real)x);
  10. }
  11. }
Add Comment
Please, Sign In to add comment