Fix roundAge()

This commit is contained in:
Robert Schulze 2023-04-11 20:31:35 +00:00
parent 9e1db557e0
commit 38e89b892a
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
2 changed files with 3 additions and 3 deletions

View File

@ -15,8 +15,7 @@ struct RoundAgeImpl
static inline ResultType apply(A x) static inline ResultType apply(A x)
{ {
return x < 1 ? 0 return (x < 18 ? 0
: (x < 18 ? 17
: (x < 25 ? 18 : (x < 25 ? 18
: (x < 35 ? 25 : (x < 35 ? 25
: (x < 45 ? 35 : (x < 45 ? 35

View File

@ -1,7 +1,8 @@
SELECT roundAge(0); SELECT roundAge(0);
SELECT roundAge(12);
SELECT roundAge(18); SELECT roundAge(18);
SELECT roundAge(25); SELECT roundAge(25);
SELECT roundAge(35); SELECT roundAge(35);
SELECT roundAge(45); SELECT roundAge(45);
SELECT roundAge(55); SELECT roundAge(55);
SELECT roundAge(56); SELECT roundAge(56);