Skip to content

Commit bdfd261

Browse files
committed
[!] First push!
1 parent d9b2ab0 commit bdfd261

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

courses/ada_essentials/273_subprogram_contracts/02-preconditions_and_postconditions.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ Preventing Exceptions with ... Exceptions?
201201
202202
function Area (Length : Positive;
203203
Height : Positive)
204-
return Positive is
205-
(Length * Height)
204+
return Positive
206205
with Pre => Length * Height <= Positive'Last;
207206
208207
* But what happens when we verify the precondition?
@@ -215,8 +214,8 @@ Preventing Exceptions with ... Exceptions?
215214
216215
function Area (Length : Positive;
217216
Height : Positive)
218-
return Positive is
219-
with Pre => Positive'Last / Height <= Length;
217+
return Positive
218+
with Pre => Length <= Positive'Last / Height;
220219
221220
------
222221
Quiz

0 commit comments

Comments
 (0)