Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Big endian float value - hot to in Delphi

  Alt 17. Feb 2012, 11:40
I wrote this, could you confirm is it valid?

Delphi-Quellcode:
function ChangeEndian32f(X: Single): Single;
var
  B: packed array [0..3] of Byte absolute X;
  L: packed array [0..3] of Byte;
  I: Integer;
begin
  for I := 0 to 3 do
    L[I] := B[3 - I]
  ;

  Result := Single(L);
end;
I also found this:

Code:
http://edn.embarcadero.com/article/28964
How it working? I don't understand that record?
  Mit Zitat antworten Zitat