Einzelnen Beitrag anzeigen

Benutzerbild von BUG
BUG

Registriert seit: 4. Dez 2003
Ort: Cottbus
2.094 Beiträge
 
#2

AW: Multiplikation Int64*UInt64 fehlerhaft?

  Alt 12. Nov 2012, 16:42
Ich würde vermuten dass UInt64 in dem Fall implizit (hart) auf Int64 gecastet wird.

Delphi scheint die vorzeichenbehafteten Typen zu bevorzugen:
Zitat von http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/expressions_xml.html:
the result is of type Int64 when at least one operand is of type Int64; otherwise, the result is of type Integer. If an operand's type is a subrange of an integer type, it is treated as if it were of the integer type.


Wenn die UInt64 Variable zu groß wäre, gäbe es ein Problem. Für Zahlen im positiven Wertebereich von Int64 funktioniert sollte das aber funktionieren.
Intellekt ist das Verstehen von Wissen. Verstehen ist der wahre Pfad zu Einsicht. Einsicht ist der Schlüssel zu allem.

Geändert von BUG (12. Nov 2012 um 16:49 Uhr)
  Mit Zitat antworten Zitat