bobobear / lambdaj

Automatically exported from code.google.com/p/lambdaj
Apache License 2.0
0 stars 0 forks source link

Lambda.sum(iterable, argument) fails with BigInteger argument #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
assertThat(sum(Arrays.asList(
    new BigDecimal("1.1"),
    new BigDecimal("2.2"),
    new BigDecimal("3.3")),
  on(BigDecimal.class)), equalTo(new BigDecimal("6.6")));

The test fails, the first element is excluded from the sum.

lambdaj version 2.3.1

Original issue reported on code.google.com by rbe...@gmail.com on 14 Sep 2010 at 2:46

GoogleCodeExporter commented 9 years ago
Fixed in release 2.3.2

By the way in your example is not necessary to use the on() method. It is 
enough to write:

assertThat(sum(Arrays.asList(
    new BigDecimal("1.1"),
    new BigDecimal("2.2"),
    new BigDecimal("3.3"))
  ), equalTo(new BigDecimal("6.6")));

Original comment by mario.fu...@gmail.com on 16 Sep 2010 at 2:18

GoogleCodeExporter commented 9 years ago
Issue 54 has been merged into this issue.

Original comment by mario.fu...@gmail.com on 16 Dec 2010 at 5:16