Java Utililty Methods Float Number Mod

List of utility methods to do Float Number Mod

Description

The list of methods to do Float Number Mod are organized into topic(s).

Method

floatmod(float dividend, float quotient)
Computes the modulo relationship.
float result = dividend % quotient;
if (result == 0 || Math.signum(dividend) == Math.signum(quotient)) {
    return result;
} else {
    return result + quotient;
floatmod2(float value)
mod
float div = value / 2;
return div - (float) Math.floor(div);
floatmodule(float[] vector)
module
float out = 0;
for (int i = 0; i < vector.length; i++) {
    out += vector[i] * vector[i];
return (float) Math.sqrt(out);
float[][]modulusSq(float[][] a)
Computes the squared modulus of a complex array.
checkDimension(a);
int M = a.length;
int N = a[0].length / 2;
float[][] modulusSq = new float[M][N];
for (int i = 0; i < M; i++) {
    for (int j = 0; j < N; j++) {
        modulusSq[i][j] = (a[i][2 * j] * a[i][2 * j]) + (a[i][2 * j + 1] * a[i][2 * j + 1]);
return modulusSq;