Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAQmekfGjOwy5s+P+E6kuUaMrOC02+tMigwN8fgUEhbixd2GYg@mail.gmail.com>
Date: Tue, 5 Jul 2022 16:14:13 +0000
From: Nikolaos Chatzikonstantinou <nchatz314@...il.com>
To: Markus Wichmann <nullplan@....net>
Cc: musl@...ts.openwall.com
Subject: Re: Re: Implementing csqrtl()

On Tue, Jul 5, 2022 at 3:35 PM Markus Wichmann <nullplan@....net> wrote:
>
> On Tue, Jul 05, 2022 at 02:28:32PM +0000, Nikolaos Chatzikonstantinou wrote:
> > On Tue, Jul 5, 2022 at 9:37 AM Szabolcs Nagy <nsz@...t70.net> wrote:
> > >
> > > * Nikolaos Chatzikonstantinou <nchatz314@...il.com> [2022-07-04 11:09:44 +0000]:
> > >
> > > > +  if ((isinf(x) || isinf(y)) && (isnan(r) || isinf(r))) {
> > >
> > > why do you need the && ?
> > > can r be other than inf or nan?
> >
> > It's the case that x^2 + y^2 is inf for x,y finite.
> >
>
> Yeah, but if x or y is infinite then so is r. So the entire part in
> front of the && is redundant, because it is contained in the second
> part.
>
> Unless I completely misunderstood how IEEE infinity works...

Yes you are right, it should be if(isinf(x) || isinf(y)).

Regards,
Nikolaos Chatzikonstantinou

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.