[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[ID 20000110.002] Perl 5.005_02 math bug



On HP PA-RISC systems (perl version 5.005_02 built for PA-RISC1.1), the
following code

#!/usr/local/bin/perl5 -w

  $x = 22818.875 - 22765.65;
  print("$x\n");

outputs:

53.2249999999985

The equiv C code

#include <stdio.h>

void main(void)
{
  double x;
  x = 22818.875 - 22765.65;
  printf("%lf\n", x);
}


correctly outputs:

53.225


Follow-Ups from:
Ronald J Kimball <rjk@linguist.dartmouth.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]