Here you can find the source of roundAngle(double a, long n)
public static double roundAngle(double a, long n)
//package com.java2s; //License from project: Open Source License public class Main { public static final long DEFAULT_N = 1000000000; public static double roundAngle(double a, long n) { return Math.round(a * n) / n; }// w w w . jav a 2 s. c o m public static double roundAngle(double a) { return roundAngle(a, DEFAULT_N); } }