2

Several questions and answers (e.g. here and here) mention that in Delphi 7 the type UInt64 exists, but contrary to what the name suggests it is a signed 64-bit integer.

What is the minimum version of Delphi that supports actual properly unsigned 64-bit integers natively?

Community
  • 1
  • 1
0xC0000022L
  • 20,597
  • 9
  • 86
  • 152

2 Answers2

1

A true unsigned UInt64 type was first supported in Delphi 2007.

QC#1210

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • `UInt64` exists as a distinct type in D2006. – Remy Lebeau Mar 17 '16 at 21:56
  • Well, that report was opened for D6 and closed for D2007. I have the RTL source code for D2006 and can see code in the `System` unit related to a distinct `UInt64` data type. And, as the QC report mentions: "*Just a note that Delphi 7 includes an undocumented UInt64 data type that appears to be **partially** functional. Danny Thorpe has mentioned that not all operators may work with this data type-- hopefully this is addressed in either a patch for D7 or D8.*" So it was a work-in-progress for awhile. D2007 is probably when `UInt64` was finalized, but is certainly not when it was first added. – Remy Lebeau Mar 17 '16 at 22:16
  • 3
    I think the question is about when the type actually first behaved correctly, when it was finalized – David Heffernan Mar 17 '16 at 22:34
  • @RemyLebeau: I pointed that out already in my question (that it exists as of Delphi 7). And my question was decidedly about starting when it **behaved** properly as *unsigned 64-bit integer*. Also wonder what *partially functional* is supposed to mean. That it works for half of the range that *should* be supported by unsigned 64-bit integers? ;o) – 0xC0000022L Mar 18 '16 at 09:08
-1

As it is stated in documentation:

Pre XE4

type UInt64 = Int64;

XE4

type UInt64 = { built-in type };
dustypup
  • 154
  • 5
  • D2007 did have native support. Also [documented](http://docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_helpupdates/HUpdate4/EN/html/devcommon/simpletypes_xml.html). – Sertac Akyuz Mar 17 '16 at 20:54
  • @dustypup: would it be possible to link to the documentation that you're referring to? Also *the* documentation is kind of a stretch, since I do not own XE4 and I am asking precisely because I do not have access to all old and latest versions. – 0xC0000022L Mar 17 '16 at 20:57
  • 2
    Documentation is irrelevant here. Or do you want to know at which version the documentation was corrected? I rather imagine that you actually care about which version the compiler was correct. Litmus test is what this program outputs: `{$APPTYPE CONSOLE} begin Writeln(low(UInt64)); Writeln(high(UInt64)); end. ` – David Heffernan Mar 17 '16 at 20:58
  • @DavidHeffernan: yep, I care about actual behavior, not purely documentation. – 0xC0000022L Mar 17 '16 at 21:00
  • Do you not have old delphi versions. I never had anything between D7 and D2010 so I can't check for you. – David Heffernan Mar 17 '16 at 21:13
  • I have Delphi 1.0 thru XE5, so I can check. But the PC is out of action at the moment while carpets are being fitted. Can check later hopefully if it's still of interest. – Deltics Mar 17 '16 at 22:47
  • @Deltics: David pointed to a QC pointing out the exact version. See the accepted answer. But thanks for the offer! – 0xC0000022L Mar 18 '16 at 09:05