Here you can find the source of swapFloat(float value)
Parameter | Description |
---|---|
value | the source value |
public static float swapFloat(float value)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . ja v a 2s. co m * Reverses the byte order of the source <tt>float</tt> value * @param value the source value * @return the converted value */ public static float swapFloat(float value) { int i = Float.floatToIntBits(value); i = swapInteger(i); return Float.intBitsToFloat(i); } /** * Reverses the byte order of the source <tt>int</tt> value * @param value the source value * @return the converted value */ public static int swapInteger(int value) { return ((value & 0xFF000000) >> 24) | ((value & 0x00FF0000) >> 8) | ((value & 0x0000FF00) << 8) | ((value & 0x000000FF) << 24); } }