Looking at http://svn.digium.com/svn/asterisk/trun ... asterisk.c
the end is the highest port number used for RTP, not the highest port number used.
Also, in that version (the last one on SVN), it appears to be rounding by masking with the wrong mask - it should be using -2, but it is using -1 - and it doesn't seem to be consistent about which way it round, and looks like it will get the even and add crossed if it actually wraps.
Incidentally, it starts looking for a free number at a random position.
PS This doesn't relate to the installer, so is more likely to be seen on Asterisk Support.