473,748 Members | 4,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Implementation of functions in math.h on clc-wiki

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

Mar 11 '06 #1
110 8585
"Gregory Pietsch" <GK**@flash.net > wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
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
Mar 11 '06 #2
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.718281828459 045235360287471 3526624977572)
/* Value of e */
#define M_LOG2E (1.442695040888 963407359924681 0018921374266)
/* Value of log2e */

[snip]
#define M_SQRT1_2 (0.707106781186 547524400844362 1048490392848)
/* Value of 1/sqrt(2) */
---------------------------------------------------------------------
Where do you have that from?

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

jacob
Mar 11 '06 #3
jacob navia <ja***@jacob.re mcomp.fr> writes:
Gregory Pietsch a icrit :
#define M_E (2.718281828459 045235360287471 3526624977572)
/* Value of e */
#define M_LOG2E (1.442695040888 963407359924681 0018921374266)
/* Value of log2e */
[...]
Where do you have that from?


They're in SUSv3, at least. Not in C99 though.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Mar 11 '06 #4
On 2006-03-11, P.J. Plauger <pj*@dinkumware .com> wrote:
"Gregory Pietsch" <GK**@flash.net > wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
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.


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?)
Mar 11 '06 #5

jacob navia wrote:
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.718281828459 045235360287471 3526624977572)
/* Value of e */
#define M_LOG2E (1.442695040888 963407359924681 0018921374266)
/* Value of log2e */

[snip]
#define M_SQRT1_2 (0.707106781186 547524400844362 1048490392848)
/* 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/...sh/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 "informatio n
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/i...ers/index.html

regards, chip

Mar 11 '06 #6
On Sat, 11 Mar 2006 16:41:16 -0500, in comp.lang.c , "P.J. Plauger"
<pj*@dinkumware .com> wrote:
"Gregory Pietsch" <GK**@flash.net > wrote in message
news:11******* *************** @i39g2000cwa.go oglegroups.com. ..
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.


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
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Mar 12 '06 #7
Mark McIntyre <ma**********@s pamcop.net> writes:
On Sat, 11 Mar 2006 16:41:16 -0500, in comp.lang.c , "P.J. Plauger"
<pj*@dinkumware .com> wrote:
"Gregory Pietsch" <GK**@flash.net > wrote in message
news:11****** *************** *@i39g2000cwa.g ooglegroups.com ...
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.


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.
--
"A lesson for us all: Even in trivia there are traps."
--Eric Sosman
Mar 12 '06 #8
P.J. Plauger said:
"Gregory Pietsch" <GK**@flash.net > wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
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.


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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Mar 12 '06 #9
On 2006-03-12, Ben Pfaff <bl*@cs.stanfor d.edu> wrote:
Mark McIntyre <ma**********@s pamcop.net> writes:
On Sat, 11 Mar 2006 16:41:16 -0500, in comp.lang.c , "P.J. Plauger"
<pj*@dinkumware .com> wrote:
"Gregory Pietsch" <GK**@flash.net > wrote in message
news:11***** *************** **@i39g2000cwa. googlegroups.co m...

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.


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.


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.
Mar 12 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2078
by: Robert Mark Bram | last post by:
Howdy All! I am trying to write a very brief comparison of the Date and Math objects in terms of instance v static objects. What I have below is my best so far. Any criticisms or suggestions are most welcome! Date is an instance object. You use Date by creating instances of it - you call methods on those instances. - you change data to do with each instance.
9
4647
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
17
3628
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels deep. In that case you need much more ram than a PC has to store functions calculated in loops so that you do not have to recalculate every time you cycle through the nest of loops. Using a HD for storage to extend ram is much too slow for many...
6
2136
by: sathyashrayan | last post by:
Following are the selected thread from the date:30-jan-2005 to 31-jan-2005. I did not use any name because of the subject is important. You can get the original thread by typing the subject "string" in google comp.lang.c archives.Hope this helps.Hope I am not bothering any one. am I? =================================Start=========================== subject: Return to Start of Line? Question: I'd like printf, the next printf, to return...
6
4477
by: Thomas Lumley | last post by:
What does the standard guarantee about the accuracy of eg the trigonometric functions? There is obviously an implementation-dependent upper bound on the accuracy, since the answer is stored in a double, but is this bound actually achieved? First, a simple example Suppose I want the arc cosine of -1, and use acos(-1.0) to compute it. The correct answer to 25 hexadecimal digits is -3.243F6A8885A308D313198A2E. This falls between two ...
8
2921
by: Sensei | last post by:
I have a quick question about the math library included in the standard C90 (and 99). The gcc, xlc and possibly other compilers/linkers on some unix platforms cannot use any math functions in math.h if a switch (-lm) is used, so *explicitly* having the linker use a file called libm.so or libm.a/dylib/whatever. Is it true on all the platforms? (answer: probably no)
5
2254
by: Ark | last post by:
Hi everyone, Does anyone know if Direct3D overloads System.Math functions? Also is it possible to access the base functions of the overloaded function (in other words restore original of the overlaoded function)? Thank you
1
2062
by: silellak | last post by:
I have found an odd error when using an XSL stylesheet transform. We have a Notes/Domino application with the following line of code in one of the stylesheets: <xsl:value-of select="format-number(number(ActEmpMoneyValue),'###,###0.00')" /> After transforming an XML document object with this stylesheet, the value in the XML node ActEmpMoneyValue is not calculated, but a flat value such as "19.31". After being processed as above on...
35
2343
by: Francine.Neary | last post by:
I'm finding it really hard to keep some of these things straight... For example, fputs is to puts as fprintf is to printf, except that fputs has the file handle at the end and fprintf at the beginning! Very illogical! And hard to remember. Now this can quite easily be corrected by macros, for example: #include <stdio.h> #define fputs(X,Y) fputs(Y,X)
17
2473
by: Jason Doucette | last post by:
I am converting a C-style unit into a C++ class. I have an implementation function that was defined in the .cpp file (so it was hidden from the interface that exists in the .h file). It uses a structure that is only needed by the implementation, so it were declared in the .cpp file, as well. Now, when converting this into a class, the class definition exists in the .h file, since it's required by the interface. The implementation...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.