Loading ...
Sorry, an error occurred while loading the content.

1302Re: "ocaml_beginners"::[] value of max_int

Expand Messages
  • Stefano Zacchiroli
    Sep 2, 2003
      On Mon, Sep 01, 2003 at 05:49:23AM -0700, Pawan Jain wrote:
      > Find out value of max_int without using the the constant max_int

      let rec find_max x =
      if x + 1 < x then x else find_max (x + 1)
      ;;
      find_max 17 ;; (* have a drink *)

      Cheers.

      --
      Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy
      zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/
      " I know you believe you understood what you think I said, but I am not
      sure you realize that what you heard is not what I meant! " -- G.Romney
    • Show all 5 messages in this topic