|
Boost Users : |
Subject: Re: [Boost-users] About naming of integer log in base 2
From: Murilo Adriano Vasconcelos (muriloufg_at_[hidden])
Date: 2010-07-16 08:37:02
Hi,
2010/7/15 Steven Watanabe <watanabesj_at_[hidden]>
> 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).
>
This is the point.
>
> Also, does the function compute floor(log2(x)) or ceil(log2(x))?
>
>
floor(log2(x))
> In Christ,
> Steven Watanabe
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Best,
-- Murilo Adriano Vasconcelos http://murilo.wordpress.com
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