Ver Mensaje Individual
  #6  
Antiguo 17-03-2012
MiguelR MiguelR is offline
Registrado
NULL
 
Registrado: ene 2012
Posts: 1
Reputación: 0
MiguelR Va por buen camino
invalid floating point operation

a mi me marca ese problema con este código, soy nuevo y no se mucho, agradecería mucho la ayuda
Código:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
m:array[1..10,1..10] of extended;
v:array[1..10] of extended;
a,i,j,x,z:integer;
k,b:extended;
linea:string;
archivo:textfile;
begin
    a:=strtoint(edit2.text);
    assignfile(archivo,edit1.text);
    reset(archivo);
    for i:=1 to a do
    for j:=1 to a do
    read(archivo,m[i,j]);

    z:=1;
    x:=1;
    b:=1;
    k:=0;
    while i<>a do begin
        for i:=z to (z+1) do begin
            k:=m[i,j];
            b:=b*k;
            for j:=x to a do begin
                v[j]:=(m[i,j])/(k);
            end;
        end;
        for i:=i+1 to a do begin
            k:=m[i,j];
            for j:=j to a do begin
                if k<>0 then
                m[i,j]:=((v[j])/(k))+m[i,j]
                else break;
            end;
        end;

        z:=z+1;
        x:=x+1;
    end;

    m[i,j]:=(m[i,j])*b;
    memo1.lines.add(floattostr(m[i,j]));
end;

end.
Responder Con Cita