From 809d6c4eb607b1393ec724a4897ca6ea1da4bc9f Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 30 Oct 2020 16:15:17 +0100 Subject: Mention we're assume 2s-complement integers. --- challenge-084/abigail/perl/ch-1.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/challenge-084/abigail/perl/ch-1.pl b/challenge-084/abigail/perl/ch-1.pl index a206fffb55..48a0bdf1de 100644 --- a/challenge-084/abigail/perl/ch-1.pl +++ b/challenge-084/abigail/perl/ch-1.pl @@ -30,10 +30,13 @@ use experimental 'lexical_subs'; # # There's a tiny thing to consider. 2,147,483,647 is the largest # positive value which fits in a 32-bit signed integer, but the -# smallest integer which fits is -2,147,483,648. So, if the input +# smallest integer which fits is -2,147,483,648 [1]. So, if the input # is 8463847412, the output should 0, but if the input is -8463847412, # the output should be -2147483648. # +# [1] We're assuming 2s-complement integers, which seems to have +# been the norm for the past 50 years. +# my $MAX = 2_147_483_647; # Maximum value which fits in a 32-bit signed integer. my $MIN = - $MAX - 1; # Minimum value which fits in a 32-bit signed integer. -- cgit