1 /* 2 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.misc; 27 28 import java.util.regex.*; 29 30 @SuppressWarnings({"unchecked", "deprecation", "all"}) 31 public class FloatingDecimal { 32 FloatingDecimal()33 public FloatingDecimal() { 34 throw new RuntimeException("Stub!"); 35 } 36 toJavaFormatString(double d)37 public static java.lang.String toJavaFormatString(double d) { 38 throw new RuntimeException("Stub!"); 39 } 40 toJavaFormatString(float f)41 public static java.lang.String toJavaFormatString(float f) { 42 throw new RuntimeException("Stub!"); 43 } 44 appendTo(double d, java.lang.Appendable buf)45 public static void appendTo(double d, java.lang.Appendable buf) { 46 throw new RuntimeException("Stub!"); 47 } 48 appendTo(float f, java.lang.Appendable buf)49 public static void appendTo(float f, java.lang.Appendable buf) { 50 throw new RuntimeException("Stub!"); 51 } 52 parseDouble(java.lang.String s)53 public static double parseDouble(java.lang.String s) throws java.lang.NumberFormatException { 54 throw new RuntimeException("Stub!"); 55 } 56 parseFloat(java.lang.String s)57 public static float parseFloat(java.lang.String s) throws java.lang.NumberFormatException { 58 throw new RuntimeException("Stub!"); 59 } 60 getBinaryToASCIIBuffer()61 private static sun.misc.FloatingDecimal.BinaryToASCIIBuffer getBinaryToASCIIBuffer() { 62 throw new RuntimeException("Stub!"); 63 } 64 getBinaryToASCIIConverter( double d)65 public static sun.misc.FloatingDecimal.BinaryToASCIIConverter getBinaryToASCIIConverter( 66 double d) { 67 throw new RuntimeException("Stub!"); 68 } 69 getBinaryToASCIIConverter( double d, boolean isCompatibleFormat)70 static sun.misc.FloatingDecimal.BinaryToASCIIConverter getBinaryToASCIIConverter( 71 double d, boolean isCompatibleFormat) { 72 throw new RuntimeException("Stub!"); 73 } 74 getBinaryToASCIIConverter( float f)75 private static sun.misc.FloatingDecimal.BinaryToASCIIConverter getBinaryToASCIIConverter( 76 float f) { 77 throw new RuntimeException("Stub!"); 78 } 79 readJavaFormatString(java.lang.String in)80 static sun.misc.FloatingDecimal.ASCIIToBinaryConverter readJavaFormatString(java.lang.String in) 81 throws java.lang.NumberFormatException { 82 throw new RuntimeException("Stub!"); 83 } 84 parseHexString(java.lang.String s)85 static sun.misc.FloatingDecimal.ASCIIToBinaryConverter parseHexString(java.lang.String s) { 86 throw new RuntimeException("Stub!"); 87 } 88 89 @dalvik.annotation.compat.UnsupportedAppUsage stripLeadingZeros(java.lang.String s)90 static java.lang.String stripLeadingZeros(java.lang.String s) { 91 throw new RuntimeException("Stub!"); 92 } 93 94 @dalvik.annotation.compat.UnsupportedAppUsage getHexDigit(java.lang.String s, int position)95 static int getHexDigit(java.lang.String s, int position) { 96 throw new RuntimeException("Stub!"); 97 } 98 99 @dalvik.annotation.compat.UnsupportedAppUsage private static boolean $assertionsDisabled; 100 101 static final sun.misc.FloatingDecimal.ASCIIToBinaryConverter A2BC_NEGATIVE_INFINITY; 102 103 static { 104 A2BC_NEGATIVE_INFINITY = null; 105 } 106 107 static final sun.misc.FloatingDecimal.ASCIIToBinaryConverter A2BC_NEGATIVE_ZERO; 108 109 static { 110 A2BC_NEGATIVE_ZERO = null; 111 } 112 113 static final sun.misc.FloatingDecimal.ASCIIToBinaryConverter A2BC_NOT_A_NUMBER; 114 115 static { 116 A2BC_NOT_A_NUMBER = null; 117 } 118 119 static final sun.misc.FloatingDecimal.ASCIIToBinaryConverter A2BC_POSITIVE_INFINITY; 120 121 static { 122 A2BC_POSITIVE_INFINITY = null; 123 } 124 125 static final sun.misc.FloatingDecimal.ASCIIToBinaryConverter A2BC_POSITIVE_ZERO; 126 127 static { 128 A2BC_POSITIVE_ZERO = null; 129 } 130 131 private static final sun.misc.FloatingDecimal.BinaryToASCIIConverter B2AC_NEGATIVE_INFINITY; 132 133 static { 134 B2AC_NEGATIVE_INFINITY = null; 135 } 136 137 private static final sun.misc.FloatingDecimal.BinaryToASCIIConverter B2AC_NEGATIVE_ZERO; 138 139 static { 140 B2AC_NEGATIVE_ZERO = null; 141 } 142 143 private static final sun.misc.FloatingDecimal.BinaryToASCIIConverter B2AC_NOT_A_NUMBER; 144 145 static { 146 B2AC_NOT_A_NUMBER = null; 147 } 148 149 private static final sun.misc.FloatingDecimal.BinaryToASCIIConverter B2AC_POSITIVE_INFINITY; 150 151 static { 152 B2AC_POSITIVE_INFINITY = null; 153 } 154 155 private static final sun.misc.FloatingDecimal.BinaryToASCIIConverter B2AC_POSITIVE_ZERO; 156 157 static { 158 B2AC_POSITIVE_ZERO = null; 159 } 160 161 static final int BIG_DECIMAL_EXPONENT = 324; // 0x144 162 163 static final long EXP_ONE = 4607182418800017408L; // 0x3ff0000000000000L 164 165 static final int EXP_SHIFT = 52; // 0x34 166 167 static final long FRACT_HOB = 4503599627370496L; // 0x10000000000000L 168 169 private static final int INFINITY_LENGTH; 170 171 static { 172 INFINITY_LENGTH = 0; 173 } 174 175 private static final java.lang.String INFINITY_REP = "Infinity"; 176 177 static final int INT_DECIMAL_DIGITS = 9; // 0x9 178 179 static final int MAX_DECIMAL_DIGITS = 15; // 0xf 180 181 static final int MAX_DECIMAL_EXPONENT = 308; // 0x134 182 183 static final int MAX_NDIGITS = 1100; // 0x44c 184 185 static final int MAX_SMALL_BIN_EXP = 62; // 0x3e 186 187 static final int MIN_DECIMAL_EXPONENT = -324; // 0xfffffebc 188 189 static final int MIN_SMALL_BIN_EXP = -21; // 0xffffffeb 190 191 private static final int NAN_LENGTH; 192 193 static { 194 NAN_LENGTH = 0; 195 } 196 197 private static final java.lang.String NAN_REP = "NaN"; 198 199 static final int SINGLE_EXP_SHIFT = 23; // 0x17 200 201 static final int SINGLE_FRACT_HOB = 8388608; // 0x800000 202 203 static final int SINGLE_MAX_DECIMAL_DIGITS = 7; // 0x7 204 205 static final int SINGLE_MAX_DECIMAL_EXPONENT = 38; // 0x26 206 207 static final int SINGLE_MAX_NDIGITS = 200; // 0xc8 208 209 static final int SINGLE_MIN_DECIMAL_EXPONENT = -45; // 0xffffffd3 210 211 private static final java.lang.ThreadLocal<sun.misc.FloatingDecimal.BinaryToASCIIBuffer> 212 threadLocalBinaryToASCIIBuffer; 213 214 static { 215 threadLocalBinaryToASCIIBuffer = null; 216 } 217 218 @SuppressWarnings({"unchecked", "deprecation", "all"}) 219 static class ASCIIToBinaryBuffer implements sun.misc.FloatingDecimal.ASCIIToBinaryConverter { 220 ASCIIToBinaryBuffer(boolean negSign, int decExponent, char[] digits, int n)221 ASCIIToBinaryBuffer(boolean negSign, int decExponent, char[] digits, int n) { 222 throw new RuntimeException("Stub!"); 223 } 224 doubleValue()225 public double doubleValue() { 226 throw new RuntimeException("Stub!"); 227 } 228 floatValue()229 public float floatValue() { 230 throw new RuntimeException("Stub!"); 231 } 232 233 private static final double[] BIG_10_POW; 234 235 static { 236 BIG_10_POW = new double[0]; 237 } 238 239 private static final int MAX_SMALL_TEN; 240 241 static { 242 MAX_SMALL_TEN = 0; 243 } 244 245 private static final int SINGLE_MAX_SMALL_TEN; 246 247 static { 248 SINGLE_MAX_SMALL_TEN = 0; 249 } 250 251 private static final float[] SINGLE_SMALL_10_POW; 252 253 static { 254 SINGLE_SMALL_10_POW = new float[0]; 255 } 256 257 private static final double[] SMALL_10_POW; 258 259 static { 260 SMALL_10_POW = new double[0]; 261 } 262 263 private static final double[] TINY_10_POW; 264 265 static { 266 TINY_10_POW = new double[0]; 267 } 268 269 int decExponent; 270 271 char[] digits; 272 273 boolean isNegative; 274 275 int nDigits; 276 } 277 278 @SuppressWarnings({"unchecked", "deprecation", "all"}) 279 static interface ASCIIToBinaryConverter { 280 doubleValue()281 public double doubleValue(); 282 floatValue()283 public float floatValue(); 284 } 285 286 @SuppressWarnings({"unchecked", "deprecation", "all"}) 287 static class BinaryToASCIIBuffer implements sun.misc.FloatingDecimal.BinaryToASCIIConverter { 288 BinaryToASCIIBuffer()289 BinaryToASCIIBuffer() { 290 throw new RuntimeException("Stub!"); 291 } 292 BinaryToASCIIBuffer(boolean isNegative, char[] digits)293 BinaryToASCIIBuffer(boolean isNegative, char[] digits) { 294 throw new RuntimeException("Stub!"); 295 } 296 toJavaFormatString()297 public java.lang.String toJavaFormatString() { 298 throw new RuntimeException("Stub!"); 299 } 300 appendTo(java.lang.Appendable buf)301 public void appendTo(java.lang.Appendable buf) { 302 throw new RuntimeException("Stub!"); 303 } 304 getDecimalExponent()305 public int getDecimalExponent() { 306 throw new RuntimeException("Stub!"); 307 } 308 getDigits(char[] digits)309 public int getDigits(char[] digits) { 310 throw new RuntimeException("Stub!"); 311 } 312 isNegative()313 public boolean isNegative() { 314 throw new RuntimeException("Stub!"); 315 } 316 isExceptional()317 public boolean isExceptional() { 318 throw new RuntimeException("Stub!"); 319 } 320 digitsRoundedUp()321 public boolean digitsRoundedUp() { 322 throw new RuntimeException("Stub!"); 323 } 324 decimalDigitsExact()325 public boolean decimalDigitsExact() { 326 throw new RuntimeException("Stub!"); 327 } 328 setSign(boolean isNegative)329 private void setSign(boolean isNegative) { 330 throw new RuntimeException("Stub!"); 331 } 332 developLongDigits(int decExponent, long lvalue, int insignificantDigits)333 private void developLongDigits(int decExponent, long lvalue, int insignificantDigits) { 334 throw new RuntimeException("Stub!"); 335 } 336 dtoa( int binExp, long fractBits, int nSignificantBits, boolean isCompatibleFormat)337 private void dtoa( 338 int binExp, long fractBits, int nSignificantBits, boolean isCompatibleFormat) { 339 throw new RuntimeException("Stub!"); 340 } 341 roundup()342 private void roundup() { 343 throw new RuntimeException("Stub!"); 344 } 345 estimateDecExp(long fractBits, int binExp)346 static int estimateDecExp(long fractBits, int binExp) { 347 throw new RuntimeException("Stub!"); 348 } 349 insignificantDigits(int insignificant)350 private static int insignificantDigits(int insignificant) { 351 throw new RuntimeException("Stub!"); 352 } 353 insignificantDigitsForPow2(int p2)354 private static int insignificantDigitsForPow2(int p2) { 355 throw new RuntimeException("Stub!"); 356 } 357 getChars(char[] result)358 private int getChars(char[] result) { 359 throw new RuntimeException("Stub!"); 360 } 361 362 private static final int[] N_5_BITS; 363 364 static { 365 N_5_BITS = new int[0]; 366 } 367 368 private final char[] buffer; 369 370 { 371 buffer = new char[0]; 372 } 373 374 private int decExponent; 375 376 private boolean decimalDigitsRoundedUp = false; 377 378 private final char[] digits; 379 380 { 381 digits = new char[0]; 382 } 383 384 private boolean exactDecimalConversion = false; 385 386 private int firstDigitIndex; 387 388 private static int[] insignificantDigitsNumber; 389 390 private boolean isNegative; 391 392 private int nDigits; 393 } 394 395 @SuppressWarnings({"unchecked", "deprecation", "all"}) 396 public static interface BinaryToASCIIConverter { 397 toJavaFormatString()398 public java.lang.String toJavaFormatString(); 399 appendTo(java.lang.Appendable buf)400 public void appendTo(java.lang.Appendable buf); 401 getDecimalExponent()402 public int getDecimalExponent(); 403 getDigits(char[] digits)404 public int getDigits(char[] digits); 405 isNegative()406 public boolean isNegative(); 407 isExceptional()408 public boolean isExceptional(); 409 digitsRoundedUp()410 public boolean digitsRoundedUp(); 411 decimalDigitsExact()412 public boolean decimalDigitsExact(); 413 } 414 415 @SuppressWarnings({"unchecked", "deprecation", "all"}) 416 private static class ExceptionalBinaryToASCIIBuffer 417 implements sun.misc.FloatingDecimal.BinaryToASCIIConverter { 418 ExceptionalBinaryToASCIIBuffer(java.lang.String image, boolean isNegative)419 public ExceptionalBinaryToASCIIBuffer(java.lang.String image, boolean isNegative) { 420 throw new RuntimeException("Stub!"); 421 } 422 toJavaFormatString()423 public java.lang.String toJavaFormatString() { 424 throw new RuntimeException("Stub!"); 425 } 426 appendTo(java.lang.Appendable buf)427 public void appendTo(java.lang.Appendable buf) { 428 throw new RuntimeException("Stub!"); 429 } 430 getDecimalExponent()431 public int getDecimalExponent() { 432 throw new RuntimeException("Stub!"); 433 } 434 getDigits(char[] digits)435 public int getDigits(char[] digits) { 436 throw new RuntimeException("Stub!"); 437 } 438 isNegative()439 public boolean isNegative() { 440 throw new RuntimeException("Stub!"); 441 } 442 isExceptional()443 public boolean isExceptional() { 444 throw new RuntimeException("Stub!"); 445 } 446 digitsRoundedUp()447 public boolean digitsRoundedUp() { 448 throw new RuntimeException("Stub!"); 449 } 450 decimalDigitsExact()451 public boolean decimalDigitsExact() { 452 throw new RuntimeException("Stub!"); 453 } 454 455 private final java.lang.String image; 456 457 { 458 image = null; 459 } 460 461 private boolean isNegative; 462 } 463 464 @SuppressWarnings({"unchecked", "deprecation", "all"}) 465 private static class HexFloatPattern { 466 HexFloatPattern()467 private HexFloatPattern() { 468 throw new RuntimeException("Stub!"); 469 } 470 471 private static final java.util.regex.Pattern VALUE; 472 473 static { 474 VALUE = null; 475 } 476 } 477 478 @SuppressWarnings({"unchecked", "deprecation", "all"}) 479 static class PreparedASCIIToBinaryBuffer 480 implements sun.misc.FloatingDecimal.ASCIIToBinaryConverter { 481 PreparedASCIIToBinaryBuffer(double doubleVal, float floatVal)482 public PreparedASCIIToBinaryBuffer(double doubleVal, float floatVal) { 483 throw new RuntimeException("Stub!"); 484 } 485 doubleValue()486 public double doubleValue() { 487 throw new RuntimeException("Stub!"); 488 } 489 floatValue()490 public float floatValue() { 491 throw new RuntimeException("Stub!"); 492 } 493 494 private final double doubleVal; 495 496 { 497 doubleVal = 0; 498 } 499 500 private final float floatVal; 501 502 { 503 floatVal = 0; 504 } 505 } 506 } 507