public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] floating point output
@ 2001-08-09 10:34 Robin Farine
  2001-08-10  3:17 ` Robin Farine
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Farine @ 2001-08-09 10:34 UTC (permalink / raw)
  To: ecos-discuss

Hi,

When using printf() and friends with special floating point numbers, i.e. x such
as finite(x) returns 0, a buffer overflow occurs. The attached patch adds checks
to the cvt() routine to handle the NaN & Inf cases separately. Is this the
correct thing to do or should the application test for special cases (I do not
have the C99 standard document to verify this).

Robin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] floating point output
  2001-08-09 10:34 [ECOS] floating point output Robin Farine
@ 2001-08-10  3:17 ` Robin Farine
  2001-08-10  9:25   ` Jonathan Larmour
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Farine @ 2001-08-10  3:17 UTC (permalink / raw)
  To: ecos-discuss

After looking at the C99 standard, I have updated the fix for the cvt() static
routine of vfnprintf.cxx so that it respects the desired case and sign (even for
NaN).

Robin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] floating point output
  2001-08-10  3:17 ` Robin Farine
@ 2001-08-10  9:25   ` Jonathan Larmour
  2001-08-10 10:25     ` Robin Farine
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Larmour @ 2001-08-10  9:25 UTC (permalink / raw)
  To: Robin Farine; +Cc: ecos-discuss

Robin Farine wrote:
> 
> After looking at the C99 standard, I have updated the fix for the cvt() static
> routine of vfnprintf.cxx so that it respects the desired case and sign (even for
> NaN).

Looks fine. ChangeLog entry? :-)

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] floating point output
  2001-08-10  9:25   ` Jonathan Larmour
@ 2001-08-10 10:25     ` Robin Farine
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Farine @ 2001-08-10 10:25 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: ecos-discuss

Jonathan Larmour <jlarmour@redhat.com> writes:

> Robin Farine wrote:
> > 
> > After looking at the C99 standard, I have updated the fix for the cvt() static
> > routine of vfnprintf.cxx so that it respects the desired case and sign (even for
> > NaN).
> 
> Looks fine. ChangeLog entry? :-)

Why not:

2001-08-10  Robin Farine  <robin.farine@terminus.org>

	* src/output/vfnprintf.cxx (cvt): Handles the cases of finite,
	NaN and infinite numbers separately.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-08-10 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-09 10:34 [ECOS] floating point output Robin Farine
2001-08-10  3:17 ` Robin Farine
2001-08-10  9:25   ` Jonathan Larmour
2001-08-10 10:25     ` Robin Farine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).