dnet45/modules/dnet-mapreduce-jobs/trunk/src/test/java/eu/dnetlib/data/mapreduce/AlgorithmsTest.java @ 57188
1 |
package eu.dnetlib.data.mapreduce; |
---|---|
2 |
|
3 |
import java.math.BigDecimal; |
4 |
|
5 |
import org.apache.commons.math.util.MathUtils; |
6 |
import org.junit.Test; |
7 |
|
8 |
/**
|
9 |
* Created by claudio on 16/11/2016.
|
10 |
*/
|
11 |
public class AlgorithmsTest { |
12 |
|
13 |
@Test
|
14 |
public void testScale() { |
15 |
final double th = 0.98; |
16 |
final double lb = th - 0.01; |
17 |
|
18 |
final double scaled = Algorithms.scale(0.9976, lb, 1, 0, 1); |
19 |
System.out.println(MathUtils.round(scaled, 2, BigDecimal.ROUND_HALF_DOWN)); |
20 |
}
|
21 |
|
22 |
}
|