stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-226) __rw::__rw_new_capacity() uses floating point math
Date Wed, 12 Dec 2007 16:08:43 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551006
] 

Farid Zaripov commented on STDCXX-226:
--------------------------------------

In my testing the algorithm in My patch is more accurate :)

--------------------------
unsigned long f2 (unsigned long x)
{
    unsigned long z = (x >> 10) * 1000 + (((x & 0x3ff) * 1000) >> 10);

    return z;
}
--------------------------

Here instead of "1000" should be "ratio * 1024" == 1,618L * 1024 == 1656.

Also in My algorithm the 1.618 ratio is present explicitly and can be changed to any other
value when it's needed.

> __rw::__rw_new_capacity() uses floating point math
> --------------------------------------------------
>
>                 Key: STDCXX-226
>                 URL: https://issues.apache.org/jira/browse/STDCXX-226
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: 23. Containers
>    Affects Versions: 4.1.2, 4.1.3, 4.2.0
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Farid Zaripov
>             Fix For: 4.2.1
>
>         Attachments: benchmark-stdcxx-226.c, new_capacity.patch
>
>
> Moved from the Rogue Wave bug tracking database:
> ****Created By: sebor @ May 09, 2002 11:15:41 AM****
> The template __rw_new_capacity() uses floating point arithmetic which may be less efficient
than integer arithmetic on some architectures. Need to change to integer arithmetic and correctly
handle integer overflow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message