Here you can find the source of sumLange(int _a, int _b)
public static int sumLange(int _a, int _b)
//package com.java2s; //License from project: Open Source License public class Main { public static int sumLange(int _a, int _b) { int a = _a; int b = _b; if (_a > _b) { b = _a;//w ww .j a v a 2 s . co m a = _b; } return (a + b) * (b - a + 1) / 2; } }