Search code examples
lispcastingclisp

Integer division in Common Lisp?


When I do (/ 7 2), what should I do to get the result 3? If I do (/ 7 2.0), I get 3.5, which is as expected.


Solution

  • (floor 7 2)
    

    Ref: http://rosettacode.org/wiki/Basic_integer_arithmetic#Common_Lisp