![]() |
Int64 in Float
Hi, noch n Problem.. :mrgreen:
wie bekomm ich einen Int64 in eine Gleitkommazahl? Grüße aus Halle, |
Re: Int64 in Float
Einfache Frage einfache Antwort:
Zuweisen :mrgreen:
Code:
function Int64ToExtend(AInt:Int64):Extended;
begin result := AInt; end; |
Re: Int64 in Float
Zitat:
Lasse mich aber gerne belehren!! [EDIT] :wall: :wall: Extended habe ich ja total vergessen [/EDIT] |
Re: Int64 in Float
Hmm Schade, hmm okay dann gibts nur ne KB Angabe im Prog! :lol: THX!
|
Re: Int64 in Float
Moin Zusammen,
und ab nach "Sonstiges" ;-) |
Re: Int64 in Float
Ich habs jetzt einfach mal ausprobiert und es geht:
Code:
Procedure test;
var aInt : Int64; aExt : extended; begin aInt := High(Int64); aExt := Aint; end; :bouncing4: :bouncing4: :bouncing4: endlich darf ich auch mal schlauer sein. :mrgreen: :mrgreen: |
Re: Int64 in Float
Int64 ist der größte Integer.
Int64 => Double, Extended, Comp Aus der OH:
Delphi-Quellcode:
Reelle Typen:
Real48 2.9 x 10^-39 .. 1.7 x 10^38 6 Byte / 48 Bit Single 1.5 x 10^-45 .. 3.4 x 10^38 4 Byte / 32 Bit * Double 5.0 x 10^-324 .. 1.7 x 10^308 8 Byte / 64 Bit * Extended 3.6 x 10^-4951 .. 1.1 x 10^4932 10 Byte / 80 Bit * Comp -2^63+1 .. 2^63 -1 8 Byte / 64 Bit Currency -922337203685477.5808 .. 922337203685477.5807 8 Byte / 64 Bit Integer-Typen: Shortint -128 .. 127 1 Byte / 8 Bit Smallint -32768 .. 32767 2 Byte / 16 Bit Longint -2147483648 .. 2147483647 4 Byte / 32 Bit * Int64 -2^63 .. 2^63-1 8 Byte / 64 Bit Byte 0 .. 255 1 Byte / 8 Bit Word 0 .. 65535 2 Byte / 16 Bit Longword 0 .. 4294967295 4 Byte / 32 Bit Zitat:
|
Re: Int64 in Float
Schön, schön....himitsu..nur...was willst du mir damit sagen :wiejetzt:
Mein Compiler mekkert nicht bei der Prozedur noch gibts zur laufzeit nen Fehler. |
Re: Int64 in Float
Das war keine Anwort auf deinen letzten Eintrag hier. (schau mal auf die Uhrzeit)
Es war mehr als Entscheidungshilfe für deine Wahl eines passenden reelen Typen und als Antwort auf Sharky's Beitrag gedacht. Zitat:
Wenn du auf Comp umsteigst, kannst'e auch 'ne schellere Art der Typenumwandlung verwenden. Da Comp und Int64 intern das selbe Format zur Speicherung nutzen.
Delphi-Quellcode:
Var C: Comp;
I: Int64;
Delphi-Quellcode:
An sonsten bist'e mit Extended (wegen der Genauigkeit) auf 'nem guten Weg.
C := Comp(I);
{oder} I := Int64(C); Denn je kleiner der Typ (Größe in Byte), desto grösser ist die Ungenauigkeit. Bei Int64 zu Single sind das immerhin bis zu 37 Milliarden. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:35 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz