Thema: Delphi Mal wieder HexToFloat

Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#6

AW: Mal wieder HexToFloat

  Alt 6. Jul 2017, 12:07
Wie wäre es mit
Delphi-Quellcode:
function HexToSingle(hex: String): Single;
var tmp: smallint;
begin
  tmp := StrToInt('$' + hex);
  Result := tmp;
end;
Eh ja, so gehen alle Nachkommastellen verloren und die Zahl ist komplett falsch.
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat