7 public static final char[]
hexDigits = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'};
10 public static String
c2hex(Color c) {
12 char[] buf7 =
new char[7];
14 for (
int pos=6; pos>=1; pos--) {
18 return new String(buf7);
22 public static String
f2hex(
float f) {
23 int i = Float.floatToIntBits(f);
24 char[] buf9 =
new char[9];
26 for (
int pos=8; pos>=1; pos--) {
30 return new String(buf9);
33 public static double[] getMinMax(
double[] a) {
34 double min = Double.MAX_VALUE;
35 double max = -Double.MAX_VALUE;
37 for (
int i=0; i<a.length; i++) {
44 double[] minAndMax =
new double[2];
50 public static double[] getMinMax(
float[] a) {
51 double min = Double.MAX_VALUE;
52 double max = -Double.MAX_VALUE;
54 for (
int i=0; i<a.length; i++) {
61 double[] minAndMax =
new double[2];
70 double[] d =
new double[len];
71 for (
int i=0; i<len; i++)
77 public static float[]
toFloat(
double[] a) {
79 float[] f =
new float[len];
80 for (
int i=0; i<len; i++)
87 char[] chars = s.toCharArray();
88 for (
int i=0; i<chars.length; i++)
89 {
if (chars[i]==
'\r') chars[i] =
'\n';}
90 return new String(chars);
105 Double d =
new Double(s);
106 defaultValue = d.doubleValue();
107 }
catch (NumberFormatException e) {}
125 if (Math.round(n1)==n1 && Math.round(n2)==n2)
130 double n = n1<n2&&n1>0.0?n1:n2;
131 double diff = Math.abs(n2-n1);
132 if (diff>0.0 && diff<n) n = diff;
134 if (n<100.0) digits = 3;
135 if (n<0.1) digits = 4;
136 if (n<0.01) digits = 5;
137 if (n<0.001) digits = 6;
138 if (n<0.0001) digits = 7;