Re: Sine code for ANSI C
"Dan Pop" <Dan.Pop@cern.c h> wrote in message
news:c7t116$sa8 $6@sunnews.cern .ch...[color=blue]
> In <Zy7oc.186082$L 31.13537@nwrddc 01.gnilink.net> "P.J. Plauger"[/color]
<pjp@dinkumware .com> writes:[color=blue]
>[color=green]
> >Sorry, but some of our customers are highly clued and they *do*
> >know when their floating-point numbers are fuzzy and when they're
> >not.[/color]
>
> Concrete examples, please.[/color]
What is the sine of 162,873 radians? If you're working in radians,
you can represent this input value *exactly* even in a float. Do
you want to be told that the return value has about 16 low-order
garbage bits because nobody could possibly expect an angle that
large to have any less fuzz? Maybe you do, but some don't. And I,
for one, have trouble justifying in this case why a standard
library function shouldn't deliver on a not-unreasonable
expectation. (The fact that it's hard to deliver on the expectation
doesn't make it unreasonable.)
P.J. Plauger
Dinkumware, Ltd.
"Dan Pop" <Dan.Pop@cern.c h> wrote in message
news:c7t116$sa8 $6@sunnews.cern .ch...[color=blue]
> In <Zy7oc.186082$L 31.13537@nwrddc 01.gnilink.net> "P.J. Plauger"[/color]
<pjp@dinkumware .com> writes:[color=blue]
>[color=green]
> >Sorry, but some of our customers are highly clued and they *do*
> >know when their floating-point numbers are fuzzy and when they're
> >not.[/color]
>
> Concrete examples, please.[/color]
What is the sine of 162,873 radians? If you're working in radians,
you can represent this input value *exactly* even in a float. Do
you want to be told that the return value has about 16 low-order
garbage bits because nobody could possibly expect an angle that
large to have any less fuzz? Maybe you do, but some don't. And I,
for one, have trouble justifying in this case why a standard
library function shouldn't deliver on a not-unreasonable
expectation. (The fact that it's hard to deliver on the expectation
doesn't make it unreasonable.)
P.J. Plauger
Dinkumware, Ltd.
Comment