mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
more bug fixes
This commit is contained in:
@@ -411,13 +411,21 @@ public class FloatDict {
|
||||
|
||||
public String minKey() {
|
||||
checkMinMax("minKey");
|
||||
return keys[minIndex()];
|
||||
int index = minIndex();
|
||||
if (index == -1) {
|
||||
return null;
|
||||
}
|
||||
return keys[index];
|
||||
}
|
||||
|
||||
|
||||
public float minValue() {
|
||||
checkMinMax("minValue");
|
||||
return values[minIndex()];
|
||||
int index = minIndex();
|
||||
if (index == -1) {
|
||||
return Float.NaN;
|
||||
}
|
||||
return values[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -452,17 +460,25 @@ public class FloatDict {
|
||||
}
|
||||
|
||||
|
||||
/** The key for a max value. */
|
||||
/** The key for a max value, or null if everything is NaN (no max). */
|
||||
public String maxKey() {
|
||||
checkMinMax("maxKey");
|
||||
return keys[maxIndex()];
|
||||
int index = maxIndex();
|
||||
if (index == -1) {
|
||||
return null;
|
||||
}
|
||||
return keys[index];
|
||||
}
|
||||
|
||||
|
||||
/** The max value. */
|
||||
/** The max value. (Or NaN if they're all NaN.) */
|
||||
public float maxValue() {
|
||||
checkMinMax("maxValue");
|
||||
return values[maxIndex()];
|
||||
int index = maxIndex();
|
||||
if (index == -1) {
|
||||
return Float.NaN;
|
||||
}
|
||||
return values[index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user