Math.log

Hünker

Mitglied
hallo ,
kann man math.log nur mit java operatoren konstruieren?
weil bei meiner aufgabe soll ich zur einer bestimmten basis den ganzzahligen anteil berechnen...mit math.log geht es ja ganz simple aber wie kann man das nur mit reinen java operatoren machen?
 
G

Gast2

Gast
Erzähl uns doch auch was Math.log ist. Mir ist es unbekannt.

[edit]Ach du meinst die Logarithmus Funktion von Math! Aber die Frage versteht ich trotzdem nicht. Was willst du daran konstruieren? [/edit]
 

Hünker

Mitglied
bei meiner aufgabe darf ich leider nicht math.log benutzen sondern nur die java operatoren also wie ich es verstanden hab math.log nur mit java operatoren schreiben...
weil ich muss den ganzzahligen anteil von einer zahl zur einer bestimmten basis berechnen
 
S

SlaterB

Gast
Man könnte sich auch den Quellcode von Math.log ansehen.
selten leider, gerade bei Math, führt hier zu
Java:
    public static native double log(double a);
in StrictMath

edit:
Zusammenfassung des Großteils der Methoden, bis auf die simple Hälfte:
Java:
public final class StrictMath {
    public static native double sin(double a);
    public static native double cos(double a);
    public static native double tan(double a);
    public static native double asin(double a);
    public static native double acos(double a); 
    public static native double atan(double a);
    public static native double exp(double a);
    public static native double log(double a);
    public static native double log10(double a);
    public static native double sqrt(double a);
    public static native double cbrt(double a);
    public static native double IEEEremainder(double f1, double f2);
    public static native double ceil(double a);
    public static native double floor(double a);
    public static native double atan2(double y, double x);
    public static native double pow(double a, double b);
    public static native double sinh(double x);
    public static native double cosh(double x);
    public static native double tanh(double x);
    public static native double hypot(double x, double y);
    public static native double expm1(double x);
    public static native double log1p(double x);
}
 
Zuletzt bearbeitet von einem Moderator:

Neue Themen


Oben