Cita:
Empezado por egostar
|
Por cierto, se resolvió demasiado fácil (amo pascal). Por si a alguien le sirve:
Código Delphi
[-]
function HexToSingle(const hex: string): Single;
var
d : Single;
Overlay: Longword absolute d;
begin
if (Length(hex)<>8) then
raise Exception.Create('Funcion hextosingle largo de string de entrada incorrecto');
Overlay := StrToInt('$' + Copy(hex, 1, 8));
result := d
end;
function Singletohex(const d: single): string;
var
Overlay: longword absolute d;
begin
result := IntToHex(Overlay, 8)
end;