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

Language semantics differ, full stop. Say you have x = 2147483647:

    x + 1 => -2147483648 (Java)
    x + 1 => Undefined behaviour (C, assuming int32_t and various things about the implementation)
    (1+ x) => 2147483648.0 (Emacs Lisp)
    (1+ x) => 2147483648 (Common Lisp)
    x + 1 => x + 1 (Prolog, using some interpretive license)


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

Search: