Java Double to Byte doubleToByte(double d)

Here you can find the source of doubleToByte(double d)

Description

double To Byte

License

LGPL

Declaration

public static Byte doubleToByte(double d) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static Byte doubleToByte(double d) {
        if (d >= Byte.MIN_VALUE && d <= Byte.MAX_VALUE) {
            return (byte) d;
        }//from   w  w w.j  a  va  2s  .  co  m
        return null;
    }

    public static byte doubleToByte(double d, byte defaultValue) {
        if (d >= Byte.MIN_VALUE && d <= Byte.MAX_VALUE) {
            return (byte) d;
        }
        return defaultValue;
    }
}

Related

  1. double2byte(double d)
  2. double2byte(double d)
  3. Double2Byte(double i)
  4. doubleToByte(double d)
  5. doubleToByte(double d)
  6. doubleToByte(double i_Value)
  7. doubleToByte(double[] values)