Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String toString(final double value) {
- if (Double.isInfinite(value)) {
- if (value > 0) {
- return "\u221E";
- } else {
- return "-\u221E";
- }
- } else if (Double.isNaN(value)) {
- return "\uFFFD"; // Unicode "Replacement Character", a question mark in a black diamond, rougly meaning "unknown" (character)
- } else {
- return "" + value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement