Here you can find the source of double2short(double d)
public static short double2short(double d)
//package com.java2s; //License from project: Apache License public class Main { public static short double2short(double d) { return (short) (((long) d << 48) >> 48); }//from w w w. j a v a 2 s .c om }