public final class NumberOutput extends Object
Constructor and Description |
---|
NumberOutput() |
Modifier and Type | Method and Description |
---|---|
static boolean |
notFinite(double value)
Helper method to verify whether given
double value is finite
(regular rational number} or not (NaN or Infinity). |
static boolean |
notFinite(float value)
Helper method to verify whether given
float value is finite
(regular rational number} or not (NaN or Infinity). |
static int |
outputInt(int v,
byte[] b,
int off) |
static int |
outputInt(int v,
char[] b,
int off)
Method for appending value of given
int value into
specified char[] . |
static int |
outputLong(long v,
byte[] b,
int off) |
static int |
outputLong(long v,
char[] b,
int off)
Method for appending value of given
long value into
specified char[] . |
static String |
toString(double v) |
static String |
toString(double v,
boolean useFastWriter) |
static String |
toString(float v) |
static String |
toString(float v,
boolean useFastWriter) |
static String |
toString(int v) |
static String |
toString(long v) |
public static int outputInt(int v, char[] b, int off)
int
value into
specified char[]
.
NOTE: caller must guarantee that the output buffer has enough room for String representation of the value.
v
- Value to append to bufferb
- Buffer to append value to: caller must guarantee there is enough roomoff
- Offset within output buffer (b
) to append number atint
public static int outputInt(int v, byte[] b, int off)
public static int outputLong(long v, char[] b, int off)
long
value into
specified char[]
.
NOTE: caller must guarantee that the output buffer has enough room for String representation of the value.
v
- Value to append to bufferb
- Buffer to append value to: caller must guarantee there is enough roomoff
- Offset within output buffer (b
) to append number atlong
public static int outputLong(long v, byte[] b, int off)
public static String toString(int v)
public static String toString(long v)
public static String toString(double v)
v
- doublepublic static String toString(double v, boolean useFastWriter)
v
- doubleuseFastWriter
- whether to use Schubfach algorithm to write output (default false)public static String toString(float v)
v
- floatpublic static String toString(float v, boolean useFastWriter)
v
- floatuseFastWriter
- whether to use Schubfach algorithm to write output (default false)public static boolean notFinite(double value)
double
value is finite
(regular rational number} or not (NaN or Infinity).value
- double
value to checkpublic static boolean notFinite(float value)
float
value is finite
(regular rational number} or not (NaN or Infinity).value
- float
value to checkCopyright © 2008–2022 FasterXML. All rights reserved.