Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I see your Haskell and raise you OCaml, which has / and /. operators and you use float_of_int with /. if you really do want a float at the end.

    # 5/2;;
    - : int = 2
    # 5 /. 2;;
    Error: This expression has type int but an expression was expected of type float
    # 5.0 /. float_of_int 2;;
    - : float = 2.5


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: