Here you can find the source of roundToShort(final double d)
final public static short roundToShort(final double d)
//package com.java2s; // License as published by the Free Software Foundation; either public class Main { final public static short roundToShort(final double d) { return (short) (d + 0.5); }//from w ww . ja v a 2 s.c o m }