Autor Beitrag
SvenPE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Mi 16.08.06 19:06 
Hallo,

wo ich ich verlässliche Informationen zu Datentypen in Delphi bekommen ?

Ich habe u.a. folgendes Problem:

Welchen Wertebereich und welche Genauigkeit hat der Datentyp Real ? Ich habe den Eindruck, auf jeder Internetseite etwas anderes zu lesen. Kann Real auch negativ sein ?

Danke

Gruß

Sven
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 16.08.06 19:13 
Zitat:
Welchen Wertebereich und welche Genauigkeit hat der Datentyp Real ?
Man könnte auch mal die Hilfe befragen.
Zitat:
Ich habe den Eindruck, auf jeder Internetseite etwas anderes zu lesen. Kann Real auch negativ sein ?
Ja.

Delphi-Hilfe hat folgendes geschrieben:
Reelle Typen
Ein reeller Typ definiert eine Menge von Zahlen, die in Gleitkommanotation dargestellt werden können. Die folgende Tabelle enthält die Bereiche und Speicherformate der fundamentalen reellen Typen in Win32.
Fundamentale reelle Typen in Win32 Typ Bereich Signifikante Stellen Größe in Byte
Real48
-2,9 x 10^39 .. 1,7 x 10^38
11-12
6

Single
-1,5 x 10^45 .. 3,4 x 10^38
7-8
4

Double
-5,0 x 10^324 .. 1,7 x 10^308
15-16
8

Extended
-3,6 x 10^4951 .. 1,1 x 10^4932
10-20
10

Comp
-2^63+1 .. 2^63 1
10-20
8

Currency
-922337203685477.5808.. 922337203685477.5807
10-20
8

_________________
Markus Kinzler.
SvenPE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Mi 16.08.06 19:23 
:idea: :o ok.

D.h. Real48 ist gleich Real ? Muss ich das dann mit real oder mit real48 deklarieren ?

Sven
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 16.08.06 19:27 
Real müßte eigentlich reichen. Der Hilfeauschnitt stammt von BDS2006 schau mal nach, vielleicht hat sich hier was seit D7 geändert.

_________________
Markus Kinzler.
SvenPE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Mi 16.08.06 19:56 
nein, Real48 kann nicht gleich Real sein, da Real einen größeren Bereich an Zahlen fassen kann als Real48, wenn ich das hier in der Hilfe von Delphi 2005 PE richtig lese.

Sven
Allesquarks
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 510

Win XP Prof
Delphi 7 E
BeitragVerfasst: Do 17.08.06 14:42 
real48 ist kaum in Gebrauch genauso wie comp.

Ein real ist ein double. Ich dachte eigentlich single aber die FPU lädt ein qword.