Cody

# Problem 44513. Add all the numbers between two limits (inclusive)

Solution 3355233

Submitted on 24 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
a = 1; b = 2; dt = 'uint64'; s_correct = 3; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
a = 1; b = 2; dt = 'int8'; s_correct = 3; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

3   Fail
a = 1; b = 2; dt = 'single'; s_correct = 12582913.5; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
a = 1; b = 2; dt = 'double'; s_correct = 6755399441055746; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

5   Fail
a = 2; b = 3; dt = 'int32'; s_correct = 5; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

6   Fail
a = 2; b = 3; dt = 'uint16'; s_correct = 5; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

7   Fail
a = 2; b = 3; dt = 'single'; s_correct = 10485762.5; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

8   Fail
a = 2; b = 3; dt = 'double'; s_correct = 5629499534213122; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

9   Fail
a = 4; b = 5; dt = 'int64'; s_correct = 9; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

10   Fail
a = 4; b = 5; dt = 'uint8'; s_correct = 9; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

11   Fail
a = 4; b = 5; dt = 'single'; s_correct = 9437188.5; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

12   Fail
a = 4; b = 5; dt = 'double'; s_correct = 5066549580791812; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

13   Fail
a = 8; b = 9; dt = 'uint32'; s_correct = 17; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

14   Fail
a = 8; b = 9; dt = 'int16'; s_correct = 17; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

15   Fail
a = 8; b = 9; dt = 'single'; s_correct = 8912904.5; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

16   Fail
a = 8; b = 9; dt = 'double'; s_correct = 4785074604081160; s = summation(a, b, dt); assert( abs(s - s_correct) < 2 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

17   Fail
a = 20; b = 22; dt = 'int32'; s_correct = 63; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

18   Fail
a = 20; b = 22; dt = 'double'; s_correct = 11821949021847573; s = summation(a, b, dt); assert( abs(s - s_correct) < 4 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

19   Fail
a = 20; b = 22; dt = 'single'; s_correct = 22020117; s = summation(a, b, dt); assert( abs(s - s_correct) < 4 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

20   Fail
a = 20; b = 30; dt = 'uint16'; s_correct = 275; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

21   Fail
a = 20; b = 30; dt = 'double'; s_correct = 70368744177664025; s = summation(a, b, dt); assert( abs(s - s_correct) < 32 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

22   Fail
a = 20; b = 30; dt = 'single'; s_correct = 131072025; s = summation(a, b, dt); assert( abs(s - s_correct) < 32 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

23   Fail
a = 1; b = 17; dt = 'uint8'; s_correct = 153; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

24   Fail
a = 1; b = 17; dt = 'double'; s_correct = 105975328731561993; s = summation(a, b, dt); assert( abs(s - s_correct) < 64 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

25   Fail
a = 1; b = 17; dt = 'single'; s_correct = 197394441; s = summation(a, b, dt); assert( abs(s - s_correct) < 64 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

26   Fail
a = -130; b = -126; dt = 'int32'; s_correct = -640; s = summation(a, b, dt); assert( isequal(s, s_correct) )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

27   Fail
a = -130; b = -126; dt = 'double'; s_correct = -26951229020045440; s = summation(a, b, dt); assert( abs(s - s_correct) < 16 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

28   Fail
a = -130; b = -126; dt = 'single'; s_correct = -50200704; s = summation(a, b, dt); assert( abs(s - s_correct) < 16 )

Error in solution: Line: 10 Column: 51 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!