在clc-wiki上的math.h中实现函数 [英] Implementation of functions in math.h on clc-wiki

查看:110
本文介绍了在clc-wiki上的math.h中实现函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个C标准库的便携式实现,用于
http ://www.clc-wiki.net 我想知道是否有人可以检查math.h中的

函数是否具有完整性/可移植性/等等。通过编写实现C99的

版本的math.h所需的200多个函数,我几乎已经中途了

,我想得到一些反馈和/或专家

我的实施建议。


此致,Gregory Pietsch

解决方案

" Gregory Pietsch" < GK ** @ flash.net>在消息中写道

新闻:11 ********************** @ i39g2000cwa.googlegr oups.com ...

我正在写一个C标准库的可移植实现
http://www.clc-wiki.net 我想知道是否有人可以检查math.h中的
函数是否具有完整性/可移植性/无论如何。通过编写实现C99的math.h版本所需的200多个函数,我几乎已经完成了一半,我想得到一些反馈和/或专家建议关于我的实现。




快速浏览一下,我会说你违反了我的版权,而且最显眼的是&b
不负责任的态度。如果侵权的东西

在短时间内没有上网,我将采取合法的

行动。


PJ Plauger

Dinkumware,Ltd。
http:// www。 dinkumware.com


Gregory Pietschaécrit:

我正在编写一个C标准库的可移植实现
http://www.clc-wiki.net 我想知道如果有人可以检查math.h中的
函数是为了理智/可移植性/无论如何。通过编写实现C99的math.h版本所需的200多个函数,我几乎已经完成了一半,我想得到一些反馈和/或专家建议关于我的实现。

真诚的,Gregory Pietsch



你在math.h写的:


/ * <文件math.h>标题应提供以下常量。



的类型为double,精确度在双倍

类型的精度范围内。

* /


#define M_E(2.7182818284590452353602874713526624977572)

/ * e * /

的价值#define M_LOG2E(1.4426950408889634073599246810018921374266)

/ * log2e的值* /


[snip]

#define M_SQRT1_2(0.7071067811865475244008443621048490392848)

/ *价值1 / sqrt(2)* /

------------------------------ ---------------------------------------

你在哪里有这个吗?


它不符合C99标准......也许还有其他一些标准?


jacob


jacob navia< ja *** @ jacob.remcomp.fr>写道:

Gregory Pietsch一个icrit:
#define M_E(2.7182818284590452353602874713526624977572)
/ * e * /
的价值#define M_LOG2E(1.4426950408889634073599246810018921374266)
/ * log2e的价值* /


[...]

你从哪里来的?




他们至少在SUSv3中。不是在C99中。

-

调试是第一次编写代码的两倍。

因此,如果你尽可能巧妙地编写代码,你是,根据定义,b $ b不够聪明,不能调试它。

--Brian Kernighan


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

解决方案

"Gregory Pietsch" <GK**@flash.net> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.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


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


jacob navia <ja***@jacob.remcomp.fr> writes:

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.
--
"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


这篇关于在clc-wiki上的math.h中实现函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆