could somebody help me finding the errors in this code , it gets a hexadecimal number and convet it
- String txt;
- String hx = "c0399999a0000000";
- void setup(){
- size(200,200);
- }
- void draw(){
- background(255,0,0);
- }
- void Test(String[] args) {
- long longHex = parseUnsignedHex(hx);
- double d = Double.longBitsToDouble(longHex);
- System.out.println(d);
- Long parseUnsignedHex() {
- if (hx.length() == 16) {
- return (parseUnsignedHex(hx.substring(0, 1)) << 60)|parseUnsignedHex(hx.substring(1));
- }
- hx = Long.parseLong(txt, 16);
- println(hx);
- return Long.parseLong(txt, 16);
- }
- }
1