AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Datentyp "Int64" fehlerhaft?

Ein Thema von Delphi-Laie · begonnen am 18. Jun 2017 · letzter Beitrag vom 19. Jun 2017
 
samso

Registriert seit: 29. Mär 2009
439 Beiträge
 
#9

AW: Datentyp "Int64" fehlerhaft?

  Alt 19. Jun 2017, 13:03
Was hältst Du von dieser Idee?


Delphi-Quellcode:
function CLZ(x: Int64): Integer;
var
  n: Integer;
begin
  if (x = 0)
  then
    Result := 64
  else begin
    n := 0;
    if (x and not $00000000FFFFFFFF)=0
    then begin
      n := n + 32;
      x := x shl 32;
    end;
    if (x and not $0000FFFFFFFFFFFF)=0
    then begin
      n := n + 16;
      x := x shl 16;
    end;
    if (x and not $00FFFFFFFFFFFFFF)=0
    then begin
      n := n + 8;
      x := x shl 8;
    end;
    if (x and not $0FFFFFFFFFFFFFFF)=0
    then begin
      n := n + 4;
      x := x shl 4;
    end;
    if (x and not $3FFFFFFFFFFFFFFF)=0
    then begin
      n := n + 2;
      x := x shl 2;
    end;
    if (x and not $7FFFFFFFFFFFFFFF)=0
    then
      n := n + 1;
    Result := n;
  end;
end;
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz