Java Integer Convert To integerToFloat(float f, int i, float offset, boolean rotate)

Here you can find the source of integerToFloat(float f, int i, float offset, boolean rotate)

Description

integer To Float

License

Open Source License

Declaration

private static float integerToFloat(float f, int i, float offset, boolean rotate) 

Method Source Code

//package com.java2s;

public class Main {
    private static float integerToFloat(float f, int i, float offset, boolean rotate) {
        if (rotate) {
            float v = f + i / (2 * offset);
            if (v < 0.0f) {
                return v + 1.0f;
            } else if (v > 1.0f) {
                return v - 1.0f;
            } else {
                return v;
            }/*from w  w w  . j ava  2  s. c  o m*/
        } else {
            if (i > 0) {
                return f + (1.0f - f) * i / offset;
            } else {
                return f + f * i / offset;
            }
        }
    }
}

Related

  1. fromIntWithPrefix(byte prefix, int v)
  2. IntegerTo(Integer i)
  3. integerToASCII(int number)
  4. integerToByte(int i)
  5. IntegerTochar(final Integer value)
  6. IntegerToInt(Integer[] in)
  7. integerToLittleEndian(byte[] buf, int offset, long value, int numBytes)
  8. integerToTimeString(Integer num)