Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#17

Re: wieder konvertierungs problem

  Alt 21. Mär 2007, 21:54
ein prob hab ich noch dann läufts..

Code:
   lmax=0;
   rmax=0;
   for (i=0; i<576;i++)
   {
      ltemp=abs(wavedata[i]);
      if (ltemp>lmax) lmax=ltemp;
   }
   for (i=0; i<576;i++)
   {
      rtemp=abs(wavedata[i+576]);
      if (rtemp>rmax) rmax=rtemp;
   }

   lphi=(float)lmax;
   rphi=(float)rmax;
Delphi-Quellcode:
   

   lmax := 0;
   rmax := 0;

   for i := 0 to 576 do
   begin
      ltemp := abs(wavedata[i]);
      if (ltemp>lmax) then
      lmax := ltemp;
   end;

   for i := 0 to 576 do
   begin
      rtemp := abs(wavedata[i+576]);
      if (rtemp>rmax) then
      rmax := rtemp;
   end;

   lphi := lmax;
   rphi := rmax;
Die beiden Werte
Delphi-Quellcode:
   lphi := lmax;
   rphi := rmax;
müßten wieder nach single konvertiert werden da sonst integer angenommen wird.
Dann sind die werte aber zu hoch und die VU ist auf anschlag.

PS: Gibt es eigentlich keine Grundregeln wie Integer zu single konvertiert werden kann?
Ähnlich wie FloatToStr usw...

Float wäre doch auch in Delphi single warum gibt es dann nicht sowas wie IntToFloat

gruss Emil
  Mit Zitat antworten Zitat