Hi List.

I have discovered the following strange bug/problem.

Please check out the following program and tell me which part is right and which is wrong,
or perhaps what i'm doing wrong in this case.

program project1;

{$mode objfpc}{$H+}

uses
  math;

var
  a,b: extended;
begin
  if SameValue(1, MaxFloat) then  // This works?
    Writeln('Same')
  else
    WriteLn('Fail');

  a := 1;
  b := MaxFloat;
  if SameValue(a,b) then  // But this fails in SameValue with SIGFPE???
    Writeln('Same')
  else
    WriteLn('Fail');
end.

My setup :

Free Pascal Compiler version 2.6.0 (from: http://svn.freepascal.org/svn/fpc/tags/release_2_6_0)
Compiler Date      : 2012/01/19
Compiler CPU Target: x86_64

FPC Compiled with extra options "-g -gl -godwarfsets",

Kind regards,
Torsten Bonde Christiansen
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to