Implementation of functions in math.h on clc-wiki

G

Gregory Pietsch

I'm writing a portable implementation of the C standard library for
http://www.clc-wiki.net and I was wondering if someone could check the
functions in math.h for sanity/portability/whatever. I'm almost halfway
through writing the over 200 functions needed to implement C99's
version of math.h, and I would like to have some feedback and/or expert
advice on my implementations.

Sincerely, Gregory Pietsch
 
P

P.J. Plauger

I'm writing a portable implementation of the C standard library for
http://www.clc-wiki.net and I was wondering if someone could check the
functions in math.h for sanity/portability/whatever. I'm almost halfway
through writing the over 200 functions needed to implement C99's
version of math.h, and I would like to have some feedback and/or expert
advice on my implementations.

At a quick glance, I'd say you're violating my copyright in the
most blatant and irresponsible manner. If the infringing stuff
isn't off the internet in short order, I will be taking legal
action.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
J

jacob navia

Gregory Pietsch a écrit :
I'm writing a portable implementation of the C standard library for
http://www.clc-wiki.net and I was wondering if someone could check the
functions in math.h for sanity/portability/whatever. I'm almost halfway
through writing the over 200 functions needed to implement C99's
version of math.h, and I would like to have some feedback and/or expert
advice on my implementations.

Sincerely, Gregory Pietsch
You write in math.h:

/* The <math.h> header shall provide for the following constants. The
values
are of type double and are accurate within the precision of the double
type.
*/

#define M_E (2.7182818284590452353602874713526624977572)
/* Value of e */
#define M_LOG2E (1.4426950408889634073599246810018921374266)
/* Value of log2e */

[snip]


#define M_SQRT1_2 (0.7071067811865475244008443621048490392848)
/* Value of 1/sqrt(2) */
---------------------------------------------------------------------
Where do you have that from?

It is not in the C99 standard... Maybe in some other standard?

jacob
 
B

Ben Pfaff

jacob navia said:
Gregory Pietsch a icrit :
#define M_E (2.7182818284590452353602874713526624977572)
/* Value of e */
#define M_LOG2E (1.4426950408889634073599246810018921374266)
/* Value of log2e */
[...]

Where do you have that from?

They're in SUSv3, at least. Not in C99 though.
 
J

Jordan Abel

At a quick glance, I'd say you're violating my copyright in the
most blatant and irresponsible manner. If the infringing stuff
isn't off the internet in short order, I will be taking legal
action.

Which pages are infringing? the header itself, the implementation files,
or all? (Unfortunately, even if he removes it, it won't be out of the
history - who are the admins of the clc-wiki?)
 
C

Chip Eastham

jacob said:
Gregory Pietsch a écrit :
I'm writing a portable implementation of the C standard library for
http://www.clc-wiki.net and I was wondering if someone could check the
functions in math.h for sanity/portability/whatever. I'm almost halfway
through writing the over 200 functions needed to implement C99's
version of math.h, and I would like to have some feedback and/or expert
advice on my implementations.

Sincerely, Gregory Pietsch
You write in math.h:

/* The <math.h> header shall provide for the following constants. The
values
are of type double and are accurate within the precision of the double
type.
*/

#define M_E (2.7182818284590452353602874713526624977572)
/* Value of e */
#define M_LOG2E (1.4426950408889634073599246810018921374266)
/* Value of log2e */

[snip]


#define M_SQRT1_2 (0.7071067811865475244008443621048490392848)
/* Value of 1/sqrt(2) */
---------------------------------------------------------------------


Hi, jacob:

You wrote (to complete the quoted material above):
Where do you have that from?

It is not in the C99 standard... Maybe in some other standard?

I have no idea how Gregory Pietsch went about preparing his math.h
or its "portable" implementation. The #define's above are consistent
with this math.h specification, copyright 1997 by The Open Group:

http://www.opengroup.org/onlinepubs/007908799/xsh/math.h.html

By C99 most writers seem to mean ISO/IEC 9899:1999 as amended
by a couple of corrections. See for example this page at gnu.org:

http://gcc.gnu.org/c99status.html

A rationale for the new standard and a copy of the working paper that
incorporates certain corrections are linked here:

http://www.open-std.org/JTC1/SC22/WG14/www/standards

This document has more than one hundred references to math.h,
many of them in Annex F on floating-point arithmetic.

Note copyrights in standards are often held by the bodies which
produce them. This is useful in maintaining the integrity of these
published works but often surprises those who expect "information
should be free".

For this reason there is an official policy that printed copies of ISO
(International Organization for Standardization) standards should be
obtained through ones national member organization, links to lists
of which are here:

http://www.iso.org/iso/en/aboutiso/isomembers/index.html

regards, chip
 
C

CBFalconer

Gregory said:
I'm writing a portable implementation of the C standard library
for http://www.clc-wiki.net and I was wondering if someone could
check the functions in math.h for sanity/portability/whatever.
I'm almost halfway through writing the over 200 functions needed
to implement C99's version of math.h, and I would like to have
some feedback and/or expert advice on my implementations.

Caution. Many of the standard library routines are intrinsically
not implementable with portable code. I suggest an enumeration of
these would be worthwhile, together with the sort of assumptions
needed for an implementation. We can start with malloc, realloc,
and free, which require assumptions about alignment and pointer
convertability.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
M

Mark McIntyre

At a quick glance, I'd say you're violating my copyright in the
most blatant and irresponsible manner. If the infringing stuff
isn't off the internet in short order, I will be taking legal
action.

At a quick glance, I saw one mention of PJ Plauger, in reference to an
algorithm. The rest looked like a fairly standard way to implement the
functions. Perhaps it would be helpful to indicate precisely what you
believe to be infringing.
Mark McIntyre
 
B

Ben Pfaff

Mark McIntyre said:
At a quick glance, I saw one mention of PJ Plauger, in reference to an
algorithm. The rest looked like a fairly standard way to implement the
functions. Perhaps it would be helpful to indicate precisely what you
believe to be infringing.

I compared a few files in the clc-wiki.net implementation against
those in _The Standard C Library_. The former is obviously a
derivative work of the latter, made without acknowledgments and
(now obviously) without permission.
 
R

Richard Heathfield

P.J. Plauger said:
At a quick glance, I'd say you're violating my copyright in the
most blatant and irresponsible manner. If the infringing stuff
isn't off the internet in short order, I will be taking legal
action.

I haven't looked, and don't plan to, so I don't know whether you're right or
not. And I think you already know that I hold you in pretty high esteem for
the huge amount you've done for the C language. But can I just put in a
plea for Gregory Pietsch?

Gregory is a longstanding contributor to comp.lang.c, and he's basically a
decent chap. If he screwed up on this occasion, I am quite sure that he
will be prepared to take down the offending material without your having to
use such - um - forthright tactics.

Ordinary, decent, law-abiding folk do make mistakes sometimes, and whilst
threatening them with legal action is undoubtedly a very effective
approach, perhaps it is best reserved for a back-up strategy, should an
initial request be rejected or ignored.
 
J

Jordan Abel

I compared a few files in the clc-wiki.net implementation against
those in _The Standard C Library_. The former is obviously a
derivative work of the latter, made without acknowledgments and
(now obviously) without permission.

Which ones did you look at? The ones I looked at looked like A) they
were probably fairly obvious implementation techniques and B) they were
simple enough to have been independently arrived at. Or were you
threatening legal action based on mere access and similarity with no
other basis? [Note: IANAL] It's possible that I didn't see the ones you
did, though, I didn't look very thoroughly through it.
 
B

Ben Pfaff

[...] Or were you threatening legal action based on mere access and
similarity with no other basis?

I'm not the one threatening legal action. Read the attributions,
fool.
 
B

Ben Pfaff

Jordan Abel said:
Which ones did you look at? The ones I looked at looked like A) they
were probably fairly obvious implementation techniques and B) they were
simple enough to have been independently arrived at.

Here is just one example. It's a very simple one because it's
less to type.

_The Standard C Library_ has in ceil.c:

#include "xmath.h"

double (ceil)(double x)
{ /* compute ceil(x) */
return (_Dint(&x, 0) < 0 && 0.0 < x ? x + 1.0 : x);
}

On clc-wiki.net:

#include "xmath.h"

double
(ceil) (double x)
{
return _Dint (&x, 0) < 0 && 0.0 < x ? x + 1.0 : x;
}

Also, all the file names are the same.
 
J

Jordan Abel

Caution. Many of the standard library routines are intrinsically
not implementable with portable code. I suggest an enumeration of
these would be worthwhile, together with the sort of assumptions
needed for an implementation. We can start with malloc, realloc,
and free, which require assumptions about alignment and pointer
convertability.

A _lot_ can be done with only a very tiny section of non-portable code,
though. malloc/realloc/free need only two things - a way to get a
[moderately large] block of memory from the OS, and a way to figure out
pointer alignments. (Once a pointer _is_ aligned 'for any data type', it
can be converted to a pointer to any data type)

much of stdio can be implemented on a bare-bones subset of the UNIX api:
open, close, read, write; limit open flags to only O_{RDONLY RDWR WRONLY
CREAT TRUNC APPEND}; the other three functions are already dead-simple.
 
P

P.J. Plauger

P.J. Plauger said:


I haven't looked, and don't plan to, so I don't know whether you're right
or
not. And I think you already know that I hold you in pretty high esteem
for
the huge amount you've done for the C language. But can I just put in a
plea for Gregory Pietsch?

Gregory is a longstanding contributor to comp.lang.c, and he's basically a
decent chap. If he screwed up on this occasion, I am quite sure that he
will be prepared to take down the offending material without your having
to
use such - um - forthright tactics.

Ordinary, decent, law-abiding folk do make mistakes sometimes, and whilst
threatening them with legal action is undoubtedly a very effective
approach, perhaps it is best reserved for a back-up strategy, should an
initial request be rejected or ignored.

Read what I said again. I'm giving him a chance, but I make no bones
about my Plan B. Ben Pfaff has kindly given a tiny sampler of code that
is clearly a direct copy; there's plenty more where that came from.
It's clear that the "author" of this stuff has to be incredibly naive
about what constitutes infringement, or incredibly brazen. In either
case, the remedy is the same. I will henceforth be monitoring this
site with extreme interest.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
J

Jordan Abel

Read what I said again. I'm giving him a chance, but I make no bones
about my Plan B. Ben Pfaff has kindly given a tiny sampler of code that
is clearly a direct copy; there's plenty more where that came from.
It's clear that the "author" of this stuff has to be incredibly naive
about what constitutes infringement, or incredibly brazen. In either
case, the remedy is the same. I will henceforth be monitoring this
site with extreme interest.

Keep in mind that it is a wiki, and anyone can contribute.

[for now, someone needs to delete this stuff, since it apparently is in
violation of copyright]
 
J

Jordan Abel

I'm writing a portable implementation of the C standard library for
http://www.clc-wiki.net and I was wondering if someone could check the
functions in math.h for sanity/portability/whatever. I'm almost halfway
through writing the over 200 functions needed to implement C99's
version of math.h, and I would like to have some feedback and/or expert
advice on my implementations.

Sincerely, Gregory Pietsch

I would like to help with this, I have ideas on implementing stdio, and
I also think that these files should be moved into a "pseudo-namespace"
[see http://clc-wiki.net/wiki/Clc_libc/stdio]
 
N

Netocrat

I'm giving him [Gregory Pietsch] a chance, but I make no bones about my
Plan B. Ben Pfaff has kindly given a tiny sampler of code that is
clearly a direct copy; there's plenty more where that came from. It's
clear that the "author" of this stuff has to be incredibly naive about
what constitutes infringement, or incredibly brazen. In either case, the
remedy is the same.

I've deleted all code-containing pages from the "Portable C library source
code implementation" category and its sub-categories on clc-wiki.net.
This isn't a judgement either way - I don't have a copy of "The Standard C
Library", and I haven't heard Gregory Pietsch's side of the story. It
seems like the most prudent thing to do though. The pages can currently
still be viewed and restored by admins, but I'd advocate the permanent
deletion of the content of any pages for which the copyright claim stands
unrefuted after giving Gregory Pietsch a chance to defend his methodology.
I will henceforth be monitoring this
site with extreme interest.

It would be a boon to the site if you were to do that.
 
J

Jordan Abel

I'm giving him [Gregory Pietsch] a chance, but I make no bones about my
Plan B. Ben Pfaff has kindly given a tiny sampler of code that is
clearly a direct copy; there's plenty more where that came from. It's
clear that the "author" of this stuff has to be incredibly naive about
what constitutes infringement, or incredibly brazen. In either case, the
remedy is the same.

I've deleted all code-containing pages from the "Portable C library source
code implementation" category and its sub-categories on clc-wiki.net.
This isn't a judgement either way - I don't have a copy of "The Standard C
Library", and I haven't heard Gregory Pietsch's side of the story. It
seems like the most prudent thing to do though. The pages can currently
still be viewed and restored by admins, but I'd advocate the permanent
deletion of the content of any pages for which the copyright claim stands
unrefuted after giving Gregory Pietsch a chance to defend his methodology.

Deleting my stdio.h, which was created after this controversy [and given
that I don't even have a copy of TSCL], seems a bit overzealous.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top