Tim Lin

Tim Lin

Title, Electrical and Computer Engineering Department, College of Engineering

Mathematics courses in ECE instructed

Mathematics Courses:

 

Data Structures and Algorithms course (ECE 3310)

Overflow concepts:

This item shows the overflow in different data types: char, short, int, long, float, and double. The following table from an earlier quiz shows that for byte or char, 5! = 120, and 6! should be computed as 720, but displayed as -48 due to overflow. The table below shows that when we calculate n! for byte (char), short, and int, up t n = 15, they all overflow as you can see from the negative value for short (and we know 13! for int is wrong).

Long data type does not overflow here. It overflows at n = 21. Float and double will also overflow with bigger n (that n is less than 200. Want to try?).

byte

short

int

long

1 ! is 1

2 ! is 2

3 ! is 6

4 ! is 24

5 ! is 120

6 ! is -48

7 ! is -80

8 ! is -128

9 ! is -128

10 ! is 0

11 ! is 0

12 ! is 0

13 ! is 0

14 ! is 0

15 ! is 0

1 ! in short is 1

2 ! in short is 2

3 ! in short is 6

4 ! in short is 24

5 ! in short is 120

6 ! in short is 720

7 ! in short is 5040

8 ! in short is -25216

9 ! in short is -30336

10 ! in short is 24320

11 ! in short is 5376

12 ! in short is -1024

13 ! in short is -13312

14 ! in short is 10240

15 ! in short is 22528

1 ! is 1

2 ! is 2

3 ! is 6

4 ! is 24

5 ! is 120

6 ! is 720

7 ! is 5040

8 ! is 40320

9 ! is 362880

10 ! is 3628800

11 ! is 39916800

12 ! is 479001600

13 ! is 1932053504

14 ! is 1278945280

15 ! is 2004310016

1 ! in long is 1

2 ! in long is 2

3 ! in long is 6

4 ! in long is 24

5 ! in long is 120

6 ! in long is 720

7 ! in long is 5040

8 ! in long is 40320

9 ! in long is 362880

10 ! in long is 3628800

11 ! in long is 39916800

12 ! in long is 479001600

13 ! in long is 6227020800

14 ! in long is 87178291200

15 ! in long is 1307674368000

Statistics (ECE 3715)

 

 

Courses with math components:

Signal and Systems (ECE 3101)

Network Security (ECE 5200)

 

 

Courses:

Fall 2019:

ECE 3101 Signal and Systems

ECE 3310 Data Structures and Algorithms

ECE 4318 Software Engineering