[fpc-devel] Proposal for 2 new compiler functions

J. Gareth Moreton gareth at moreton-family.com
Wed Jun 13 10:32:33 CEST 2018


I started to think about such names while 
sleeping on it. Something like BitCount 
would work splendidly for FLog2, and a 
note in the documentation can be made to 
show the similarity to the binary 
logarithm. BinSearchSize is a little 
restrictive, but I'm sure something 
similar can be found.

All these arguments over names!

Gareth

On Wed 13/06/18 03:11 , Wolf 
wv99999 at gmail.com sent:
> Why not call them UIntSize instead of 
FLog2 and BinSearchSize forCLog2? 
> 
> That would give an indication of how to 
use them, and class them along 
> 
> SizeOf, for finding them easily. After 
all, you are looking for the size 
> 
> of a variable?
> 
> 
> 
> Wolf
> 
> 
> 
> 
> 
> On 13/06/2018 12:13, J. Gareth Moreton 
wrote:
> 
> > I can see where you're coming from 
here.
> 
> > If not a logarithm, what would you 
call
> 
> > these functions that concisely and
> 
> > compactly describes their behaviour 
and
> 
> > purpose? While "bit scan reverse" is
> 
> > effectively a truncated log2, with a 
flag
> 
> > set if the input was zero, it's not a 
name
> 
> > that jumps out at the user as "aah, 
that's
> 
> > what I need" or "ah, I know what
> that's
> > for", and there's no equivalent to 
what
> 
> > I'm calling CLog2 yet.
> 
> >
> 
> > Would "ILog2" and "CILog2"
> differentiate
> > them enough from the mathematical
> 
> > functions?
> 
> >
> 
> > Gareth
> 
> >
> 
> >
> 
> > 
__________________________________________
_____
> 
> > fpc-devel maillist  -  fpc-
devel at lists.freepascal.org
> > http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel
> 
> 
> 
__________________________________________
_____
> 
> fpc-devel maillist  -  fpc-
devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel
> 
> 
> 
> 




More information about the fpc-devel mailing list