delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/23/12:15:23

Message-ID: <321DD829.38F8@pobox.oleane.com>
Date: Fri, 23 Aug 1996 18:11:21 +0200
From: Francois Charton <deef AT pobox DOT oleane DOT com>
Organization: CCMSA
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: strtod() hairsplitting problem

Hi, 

Looking in the code of strdod.c (in subdir src/libc/ansi/stdlib) I 
noticed the following which seems quite strange to me : 


double
strtod(const char *s, char **sret)
{
  long double r;                /* result */
  int e;                        /* exponent */
  long double d;                /* scale */
  int sign;                     /* +- 1.0 */
  int esign;
  int i;
  int flags=0;

  r = 0.0;
  sign = 1.0;
  e = 0;
  esign = 1;

The variable "sign" is defined as an int, but given a floating point 
value. It is not a real bug, because it does not seem to prevent strtod() 
from working correctly. But it is *so easy* to correct...

Could it be put in the "WIP" version?

Francois

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019