package eu.dnetlib.data.mapreduce;

import java.math.BigDecimal;

import org.apache.commons.math.util.MathUtils;
import org.junit.Test;

/**
 * Created by claudio on 16/11/2016.
 */
public class AlgorithmsTest {

	@Test
	public void testScale() {
		final double th = 0.98;
		final double lb = th - 0.01;

		final double scaled = Algorithms.scale(0.9976, lb, 1, 0, 1);
		System.out.println(MathUtils.round(scaled, 2, BigDecimal.ROUND_HALF_DOWN));
	}

}
