Boost logo

Boost Users :

Subject: Re: [Boost-users] About naming of integer log in base 2
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-07-15 13:14:53


AMDG

Paul A. Bristow wrote:
> Murilo Adriano wrote:
>> I implemented a function [0] which computes the logarithm in base two of integers and want to know what naming is most
>> appropriated:
>>
>> ilog2
>>
>> or simply
>>
>> log2
>
> My instinct is for log2 so it might be specialised for floating point too.
>

log2 conflicts with the C++0x library which works with floating point
(and returns a double when it's given an integer).

Also, does the function compute floor(log2(x)) or ceil(log2(x))?

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net