Autor |
Beitrag |
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 15:28
Hi Leute,
wie lautet der Code der Funktion ln also von dem Logaritmus??
Vielen Dank, Scorpion!
_________________ Aus dem Urlaub zurück!
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 15:36
Moin!
IMHO macht das die FPU - und die sollte man es auch besser machen lassen...
cu
Narses
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 15:38
das ist mir eigentlich egal, ich will halt nur den code!
_________________ Aus dem Urlaub zurück!
|
|
BenBE
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: Mi 12.01.05 15:49
Schau dich im Internet um.
Ist bei Delphi aber Compilermagic und dafür ist bekanntlich die FPU zuständlich ...
Kann evtl. in meinem ASM-Handbuch ja mal nachgucken, auch wenn ich diese Art der Anfrage plumb und doof finde!
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 15:50
Moin!
Damit wollte ich andeuten, dass das nicht ganz leicht ist (IMHO kommt man nicht ohne eine Logarithmen-Tabelle aus, sonst dauert das viel zu lange).
Wofür sollte man den ln selbst in Code berechnen können wollen, wo das um Zehnerpotenzen langsamer ist, als es die FPU in halb besoffenem Zustand mit dem kleinen Beinchen kann... ?!
cu
Narses
|
|
IngoD7
Beiträge: 629
D7
|
Verfasst: Mi 12.01.05 15:54
ScorpionKing hat folgendes geschrieben: | das ist mir eigentlich egal, ich will halt nur den code! |
Was verstehst du darunter? Die Delphi-Syntax? Irgendwelchen Assembler-Code? Oder was?
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 16:14
na ja, irgendwo in der datei math.dcu ist ja bestimmt solch eine funktion:
Quelltext 1: 2: 3: 4:
| function ln(x: real): real; begin ... end; |
und ich will halt wissen: was steht da anstatt ...?
_________________ Aus dem Urlaub zurück!
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 16:23
Moin!
Nein, falsch, gehe nicht über "begin" und ziehe eine Exception ein...
Das ist ein (einziger) Assembler-Befehl (der FPU).
cu
Narses
PS: Nun verrate doch endlich, wofür das gut sein soll...
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 16:29
mach ich einfach aus spaß!
na gut, dann formulier ich meine frage um:
es gibt doch bestimmt eine formel für den logarithmus. wie lautet die?? es muss ja eine formel geben! ich habe schon gegoogelt, habe aber nichts gefunden!
_________________ Aus dem Urlaub zurück!
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 16:31
Moin!
Sag mal, in welcher Klasse bist du?
cu
Narses
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 16:32
in der 8.ten. habe seit der 3.klasse eine 1 in mathe, deshalb macht mir das auch spaß!
das beantwortet aber nicht meine frage...
_________________ Aus dem Urlaub zurück!
Zuletzt bearbeitet von ScorpionKing am Mi 12.01.05 16:33, insgesamt 1-mal bearbeitet
|
|
IngoD7
Beiträge: 629
D7
|
Verfasst: Mi 12.01.05 16:33
Narses hat folgendes geschrieben: |
Das ist ein (einziger) Assembler-Befehl (der FPU). |
Zustimmung. Da steht in keiner Unit auch nur ein kleines Wörtchen von drin.
Narses hat folgendes geschrieben: | PS: Nun verrate doch endlich, wofür das gut sein soll... |
Würde mich ja auch mal interessieren ...
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 16:36
Moin!
Dann warte, bis du in der 10. Klasse warst oder lies ein Mathebuch aus der 10. Klasse.
cu
Narses
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 16:37
das finde ich echt toll!
gibt es denn dazu keine seite, ich will mir nämlich nicht 50 bücher kaufen und alles durchsuchen, wenn das jemand von euch weiss!
_________________ Aus dem Urlaub zurück!
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 16:40
Moin!
Wie willst du etwas verstehen, für das dir die Grundlagen in der Mathematik fehlen?
Der natürliche Logarithmus ist so definiert: ln a=b <=> e^b=a
Jetzt schlauer?
cu
Narses
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 16:42
genau sowas wollte ich wissen, danke!
warum haben wir eigentlich so lange um den heißen brei geredet??
PS: für alle die nicht wissen, was e ist: e = Eulersche Zahl!
hier: e = 2.7182818284590452353602874713526624977572470936999
_________________ Aus dem Urlaub zurück!
Zuletzt bearbeitet von ScorpionKing am Mi 12.01.05 16:46, insgesamt 2-mal bearbeitet
|
|
Narses
Beiträge: 10182
Erhaltene Danke: 1255
W10ent
TP3 .. D7pro .. D10.2CE
|
Verfasst: Mi 12.01.05 16:43
Moin!
ScorpionKing hat folgendes geschrieben: | genau sowas wollte ich wissen, danke!
warum haben wir eigentlich so lange um den heißen brei geredet?? |
Weil du nicht die richtige Frage gestellt hast? Und du weißt, was das "e" in der Formel soll, ja?
cu
Narses
|
|
Karlson
Beiträge: 2088
|
Verfasst: Mi 12.01.05 16:43
Hm, wie wärs wenn du dir erstmal klar machst, was ein Logarithmus überhaupt ist? Hier z.B.
Und wie BenBE schon sagte ist das Compilermagic, was bedeutet dass in keiner Unit die Function auftaucht, weil der compiler das so zu sagen schon selber kann.
Aber vielleicht kann ben mal den Asm-befehl posten. Ob man mit dem all zuviel anfangen kann bezweifel ich zwar, aber es wäre immerhin mal etwas.
|
|
IngoD7
Beiträge: 629
D7
|
Verfasst: Mi 12.01.05 16:44
Es gibt für "Logarithmus" ebensowenig eine Formel, wie es eine für "Wurzel" gibt. Es ist - wie erklärt man das bloß?? - eine eigenständige mathematische Funktion. Die hat keine Übersetzung in Form einer Formel. Wie gesagt, genau so, wie beim Wurzelziehen.
|
|
ScorpionKing
Beiträge: 1150
Win XP
|
Verfasst: Mi 12.01.05 16:45
@narses: ich weiß was e ist!! steht oben!
e = Eulersche Zahl!
_________________ Aus dem Urlaub zurück!
|
|