Skip to main content
Commonmark migration
Source Link

#Java 8, 198 182 30 bytes

Java 8, 198 182 30 bytes

d->Math.log(d)//)d(pxe.htaM<-d

Try it online.

and reversed:

d->Math.exp(d)//)d(gol.htaM<-d

Try it online.

Uses the comment trick (//) with built-ins for Math.log and Math.exp.

#Java 8, 198 182 30 bytes

d->Math.log(d)//)d(pxe.htaM<-d

Try it online.

and reversed:

d->Math.exp(d)//)d(gol.htaM<-d

Try it online.

Uses the comment trick (//) with built-ins for Math.log and Math.exp.

Java 8, 198 182 30 bytes

d->Math.log(d)//)d(pxe.htaM<-d

Try it online.

and reversed:

d->Math.exp(d)//)d(gol.htaM<-d

Try it online.

Uses the comment trick (//) with built-ins for Math.log and Math.exp.

deleted 471 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 78, 198 182182 30 bytes

class M{public static void main(String[]a){System.out.print(Mathd->Math.log(new Double(a[0]))d);}}//}};)))]0[a(elbuoD wend(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalchtaM<-d

ANDTry it online.

class M{public static void main(String[]a){System.out.print(Math.exp(new Double(a[0])));}}//}};)))]0[a(elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

Ungolfed:

class M{
    public static void main(String[]a){
        System.out.print(Math.log(new Double(a[0])));
    }
}
//}};)))]0[a(elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND and reversed:

class M{
    public static void main(String[]a){
        System.out.print(Mathd->Math.exp(new Double(a[0]))d);
    }
}
//}};)))]0[a(elbuoD wend(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalchtaM<-d

 

#Java 8, 192 176 bytesTry it online.

class M{public static void main...

replacedUses the comment trick (//) with

interface M{static void main...

Usage:

java -jar M.jar 5

Output: built-ins for Math.log and Math.exp.

1.6094379124341003

148.4131591025766

#Java 7, 198 182 bytes

class M{public static void main(String[]a){System.out.print(Math.log(new Double(a[0])));}}//}};)))]0[a(elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{public static void main(String[]a){System.out.print(Math.exp(new Double(a[0])));}}//}};)))]0[a(elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

Ungolfed:

class M{
    public static void main(String[]a){
        System.out.print(Math.log(new Double(a[0])));
    }
}
//}};)))]0[a(elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{
    public static void main(String[]a){
        System.out.print(Math.exp(new Double(a[0])));
    }
}
//}};)))]0[a(elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

 

#Java 8, 192 176 bytes

class M{public static void main...

replaced with

interface M{static void main...

Usage:

java -jar M.jar 5

Output:

1.6094379124341003

148.4131591025766

#Java 8, 198 182 30 bytes

d->Math.log(d)//)d(pxe.htaM<-d

Try it online.

and reversed:

d->Math.exp(d)//)d(gol.htaM<-d

Try it online.

Uses the comment trick (//) with built-ins for Math.log and Math.exp.

Double.parseDouble -> new Double (-16 bytes)
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#Java 7, 198198 182 bytes

class M{public static void main(String[]a){System.out.print(Math.log(new Double.parseDouble(a[0])));}}//}};)))]0[a(elbuoDesrap.elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{public static void main(String[]a){System.out.print(Math.exp(new Double.parseDouble(a[0])));}}//}};)))]0[a(elbuoDesrap.elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

Ungolfed:

class M{
    public static void main(String[]a){
        System.out.print(Math.log(new Double.parseDouble(a[0])));
    }
}
//}};)))]0[a(elbuoDesrap.elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{
    public static void main(String[]a){
        System.out.print(Math.exp(new Double.parseDouble(a[0])));
    }
}
//}};)))]0[a(elbuoDesrap.elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

#Java 8, 192192 176 bytes

class M{public static void main...

replaced with

interface M{static void main...

Usage:

java -jar M.jar 5

Output:

1.6094379124341003

148.4131591025766

#Java 7, 198 bytes

class M{public static void main(String[]a){System.out.print(Math.log(Double.parseDouble(a[0])));}}//}};)))]0[a(elbuoDesrap.elbuoD(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{public static void main(String[]a){System.out.print(Math.exp(Double.parseDouble(a[0])));}}//}};)))]0[a(elbuoDesrap.elbuoD(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

Ungolfed:

class M{
    public static void main(String[]a){
        System.out.print(Math.log(Double.parseDouble(a[0])));
    }
}
//}};)))]0[a(elbuoDesrap.elbuoD(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{
    public static void main(String[]a){
        System.out.print(Math.exp(Double.parseDouble(a[0])));
    }
}
//}};)))]0[a(elbuoDesrap.elbuoD(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

#Java 8, 192 bytes

class M{public static void main...

replaced with

interface M{static void main...

Usage:

java -jar M.jar 5

Output:

1.6094379124341003

148.4131591025766

#Java 7, 198 182 bytes

class M{public static void main(String[]a){System.out.print(Math.log(new Double(a[0])));}}//}};)))]0[a(elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{public static void main(String[]a){System.out.print(Math.exp(new Double(a[0])));}}//}};)))]0[a(elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

Ungolfed:

class M{
    public static void main(String[]a){
        System.out.print(Math.log(new Double(a[0])));
    }
}
//}};)))]0[a(elbuoD wen(pxe.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

AND

class M{
    public static void main(String[]a){
        System.out.print(Math.exp(new Double(a[0])));
    }
}
//}};)))]0[a(elbuoD wen(gol.htaM(tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilbup{M ssalc

#Java 8, 192 176 bytes

class M{public static void main...

replaced with

interface M{static void main...

Usage:

java -jar M.jar 5

Output:

1.6094379124341003

148.4131591025766
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading