cast i or n to Long - so that it does a computation with Long's. Else it can overflow and the resulting int becomes a Long.