[ 
https://issues.apache.org/jira/browse/LANG-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Timm Zietek updated LANG-1764:
------------------------------
    Description: 
I ran into several hash collisions while running some local tests on the 
"hashCode" method inside the Fraction class.

Here are some examples of fraction pairs "(numerator, denominator)" that cause 
a hash collision.

 
||Pair1||Pair2||Hash||
|(0, 37)|(-464320789, 46)|23310|
|(0, 37)|(-464320788, 9)|23310|
|(0, 37)|(1857283155, 38)|23310|
|(0, 25185704)|(1161454280, 1050304)|25208977|
|(0, 38817068)|(1509581512, 18875972)|38840341|
|(0, 38817068)|(-2146369536, 2145078572)| 38840341|
|(1400217380, 128)|(2092630052, 150535040)|268458909|
|(1400217380, 128)|(-580400986, 268435638)|268458909|
|(1400217380, 2147483592)|(-2147483648, 268435452)|-1879024923|
|(1756395909, 4194598)|(1174949894, 42860673)|566357064|

  was:
I ran into several hash collisions while running some local tests on the 
Fraction class.

Here are some examples of fraction pairs "(numerator, denominator)" that cause 
a hash collision.

 
||Pair1||Pair2||Hash||
|(0, 37)|(-464320789, 46)|23310|
|(0, 37)|(-464320788, 9)|23310|
|(0, 37)|(1857283155, 38)|23310|
|(0, 25185704)|(1161454280, 1050304)|25208977|
|(0, 38817068)|(1509581512, 18875972)|38840341|
|(0, 38817068)|(-2146369536, 2145078572)| 38840341|
|(1400217380, 128)|(2092630052, 150535040)|268458909|
|(1400217380, 128)|(-580400986, 268435638)|268458909|
|(1400217380, 2147483592)|(-2147483648, 268435452)|-1879024923|
|(1756395909, 4194598)|(1174949894, 42860673)|566357064|


> Several hash collisions in Fraction class
> -----------------------------------------
>
>                 Key: LANG-1764
>                 URL: https://issues.apache.org/jira/browse/LANG-1764
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.math.*
>            Reporter: Timm Zietek
>            Priority: Minor
>
> I ran into several hash collisions while running some local tests on the 
> "hashCode" method inside the Fraction class.
> Here are some examples of fraction pairs "(numerator, denominator)" that 
> cause a hash collision.
>  
> ||Pair1||Pair2||Hash||
> |(0, 37)|(-464320789, 46)|23310|
> |(0, 37)|(-464320788, 9)|23310|
> |(0, 37)|(1857283155, 38)|23310|
> |(0, 25185704)|(1161454280, 1050304)|25208977|
> |(0, 38817068)|(1509581512, 18875972)|38840341|
> |(0, 38817068)|(-2146369536, 2145078572)| 38840341|
> |(1400217380, 128)|(2092630052, 150535040)|268458909|
> |(1400217380, 128)|(-580400986, 268435638)|268458909|
> |(1400217380, 2147483592)|(-2147483648, 268435452)|-1879024923|
> |(1756395909, 4194598)|(1174949894, 42860673)|566357064|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to