Created
October 4, 2016 17:31
-
-
Save pabloleonalcaide/6e8d02a05341b00953186ff16c11dea3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LongUnsigned { | |
public static void main(String[]args){ | |
//Este método acepta como parámetro una cadena de caracteres, lo que permite el uso de un valor mayor | |
long number = Long.parseUnsignedLong("17916881237904312345"); | |
//Para poder visualizar esta variable tenemos que hacer uso del método toUNsignedString() | |
String numberStr = Long.toUnsignedString(number); | |
System.out.println(numberStr); | |
System.out.println(number); | |
//compareUnsigned(long, long) --> nos permite comparar dos valores tratándolos como variable sin signo. | |
/*divideUnsigned(long, long) --> permite dividir ambas variables como sin signo y tratar el resultado del | |
* mismo modo | |
*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment