/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.edu.amu.wmi.dino.ultrapotegowanie;

import java.util.Random;

/**
 *
 * @author bikol
 */
public class UltraPotegowanie {
    
    /**
     * Zwaraca wartość a^b.
     * @param a
     * @param b
     * @return 
     */
    public static String poteguj(String a, String b){
        double aa = Double.parseDouble(a);
        double bb = Double.parseDouble(b);
        double power = Math.pow(aa, bb);
        if (power % 1 == 0)
               return Long.toString(Math.round(power));
        String result =  Double.toString(power);
        if (result.contains("E")){
            return String.format("%.12f", power);
        }
        return result;
    }
    
}
@@ -474,85 +474,892 @@
     
-double aa = Double.parseDouble(a);%0A        double bb = Double.parseDouble(b);
+char%5B%5D checka = a.toLowerCase().toCharArray();%0A        char%5B%5D checkb = b.toLowerCase().toCharArray();%0A        char x = 'x';%0A        %0A        double aa;        %0A        if (a.length() != 1) %7B%0A            if (checka%5B1%5D == x) %7B%0A                String tempa = a.substring(2);%0A                long na = Long.parseLong(tempa, 16);%0A                aa = (double)na;%0A            %7D else %7B%0A                aa = Double.parseDouble(a);%0A            %7D%0A        %7D else %7B%0A            aa = Double.parseDouble(a);%0A        %7D%0A        %0A        double bb;%0A        if (b.length() != 1) %7B%0A            if (checkb%5B1%5D == x) %7B%0A                String tempb = b.substring(2);%0A                long nb = Long.parseLong(tempb, 16);%0A                bb = (double)nb;%0A            %7D else %7B%0A                bb = Double.parseDouble(b);%0A            %7D%0A        %7D else %7B%0A            bb = Double.parseDouble(b);%0A        %7D%0A        
 %0A   
@@ -1658,9 +1658,10 @@
  %7D%0A    %0A
-
 %7D
+%0A

Update UltraPotegowanie.java