Skip to content

Commit

Permalink
add overflow discussion point, fixes #134
Browse files Browse the repository at this point in the history
  • Loading branch information
wikfeldt committed Apr 23, 2021
1 parent 4b7c55a commit b2c9508
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions content/test-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ Also discuss why some are easier to test than others.
```{literalinclude} code/factorial.f90
:language: fortran
```
````
Discussion point: The factorial grows very rapidly. What happens if you
pass a large number as argument to the function?
`````
``````{solution}
Expand Down Expand Up @@ -118,6 +121,10 @@ function more fine-grained and test only one concept.
```
````
`````
Notes on the discussion point: Programming languages differ in the way they deal with integer
overflow. Python automatically converts to the necessary `long` type, in Julia you would
observe a "wrap-around", in C/C++ you get undefined behaviour for signed integers.
Testing for overflow likewise depends on the language.
``````
```````

Expand Down

0 comments on commit b2c9508

Please sign in to comment.