473,473 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error in K&R 2?

This is not mentioned in the official list at
http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html.
On page 257, FLT_MAX_EXP is defined as
"maximum n such that (FLT_RADIX^n)-1 is representable"
(at least, that's the closest I can express it in ASCII); whereas it
should be
"maximum n such that FLT_RADIX^(n-1) is representable"
(i.e., the "-1" should be in superscript along with the "n").
In fact, if I have things straight, the definition in the book would
make FLT_MAX_EXP essentially a synonym for FLT_MANT_DIG. The same goes
for DBL_MAX_EXP on page 258. Am I missing something, or is this an
error they should be informed of?

-Daniel.

Nov 14 '05 #1
9 1311
In article <11**********************@c13g2000cwb.googlegroups .com>,
cr******@hevanet.com says...

BLASPHEMER!!!
Nov 14 '05 #2

"Sniper1" <sp******@example.net> wrote in message
news:MP************************@news.verizon.net.. .
In article <11**********************@c13g2000cwb.googlegroups .com>,
cr******@hevanet.com says...

BLASPHEMER!!!


Yes.... That's a usefull answer.
Nov 14 '05 #3
cr******@hevanet.com wrote:
This is not mentioned in the official list at
http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html.
On page 257, FLT_MAX_EXP is defined as
"maximum n such that (FLT_RADIX^n)-1 is representable"
(at least, that's the closest I can express it in ASCII); whereas it
should be
"maximum n such that FLT_RADIX^(n-1) is representable"
(i.e., the "-1" should be in superscript along with the "n").
In fact, if I have things straight, the definition in the book would
make FLT_MAX_EXP essentially a synonym for FLT_MANT_DIG. The same goes
for DBL_MAX_EXP on page 258. Am I missing something, or is this an
error they should be informed of?


I haven't got K&R to hand, but as for the Standard parts of this, no,
you haven't missed anything. FLT_MAX_EXP should indeed mean "maximum n
such that FLT_RADIX^(n-1) is representable" and not "maximum n such that
(FLT_RADIX^n)-1 is representable"; and that latter is not by definition,
but AFAICT is in effect, equal to FLT_MANT_DIG.
And yes, if you haven't misread K&R and this error is indeed in K&R2,
then IMO they should be informed.

Richard
Nov 14 '05 #4

"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
news:41****************@news.individual.net...
cr******@hevanet.com wrote:
This is not mentioned in the official list at
http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html.
On page 257, FLT_MAX_EXP is defined as
"maximum n such that (FLT_RADIX^n)-1 is representable"
(at least, that's the closest I can express it in ASCII); whereas it
should be
"maximum n such that FLT_RADIX^(n-1) is representable"
(i.e., the "-1" should be in superscript along with the "n").
In fact, if I have things straight, the definition in the book would
make FLT_MAX_EXP essentially a synonym for FLT_MANT_DIG. The same goes
for DBL_MAX_EXP on page 258. Am I missing something, or is this an
error they should be informed of?


I haven't got K&R to hand, but as for the Standard parts of this, no,
you haven't missed anything. FLT_MAX_EXP should indeed mean "maximum n
such that FLT_RADIX^(n-1) is representable" and not "maximum n such that
(FLT_RADIX^n)-1 is representable"; and that latter is not by definition,
but AFAICT is in effect, equal to FLT_MANT_DIG.
And yes, if you haven't misread K&R and this error is indeed in K&R2,
then IMO they should be informed.

Richard


Now *that's* a usefull answer. Thanks.
Nov 14 '05 #5

<cr******@hevanet.com> a écrit dans le message de
news:11**********************@c13g2000cwb.googlegr oups.com...
This is not mentioned in the official list at
http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html.
On page 257, FLT_MAX_EXP is defined as
"maximum n such that (FLT_RADIX^n)-1 is representable"
(at least, that's the closest I can express it in ASCII); whereas it
should be
"maximum n such that FLT_RADIX^(n-1) is representable"
(i.e., the "-1" should be in superscript along with the "n").
In fact, if I have things straight, the definition in the book would
make FLT_MAX_EXP essentially a synonym for FLT_MANT_DIG. The same goes
for DBL_MAX_EXP on page 258. Am I missing something, or is this an
error they should be informed of?

-Daniel.


You could maybe get Christmas chocolate for pointing that error out ;)

K
Nov 14 '05 #6
Richard Bos <rl*@hoekstra-uitgeverij.nl> spoke thus:
And yes, if you haven't misread K&R and this error is indeed in K&R2,
then IMO they should be informed.


I can see the text OP described on page 258, so it would appear that
the error does, in fact, exist.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #7
Christopher Benson-Manica wrote:
Richard Bos <rl*@hoekstra-uitgeverij.nl> spoke thus:
And yes, if you haven't misread K&R and this error is indeed in K&R2, then IMO they should be informed.


I can see the text OP described on page 258, so it would appear that
the error does, in fact, exist.

Thanks. I've emailed them about it.
-Daniel.

Nov 14 '05 #8
> Christopher Benson-Manica wrote:
Richard Bos <rl*@hoekstra-uitgeverij.nl> spoke thus:
And yes, if you haven't misread K&R and this error is indeed in K&R2, then IMO they should be informed.


I can see the text OP described on page 258, so it would appear that the error does, in fact, exist.

Thanks. I've emailed them about it.
-Daniel.


DMR just added it to the list of errata. It turns out that the original
ANSI standard was ambiguous on this point:

maximum integer such that FLT_RADIX raised to that
power minus 1 is a representable....

-Daniel.

Nov 14 '05 #9
cr******@hevanet.com spoke thus:
DMR just added it to the list of errata. It turns out that the original
ANSI standard was ambiguous on this point: maximum integer such that FLT_RADIX raised to that
power minus 1 is a representable....


Were you awarded a medal? ;) Well done.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #10

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

Similar topics

0
by: Alex | last post by:
Hi, I have a problem with the VB.NET compiler: When I open my solution I recive the message : "Visual Basic .Net compiler is unable to recover from the following error : System Error...
5
by: s_m_b | last post by:
function saveState() { document.write (" | <a href = 'myhomepage.asp? view=mhp&amp;action=save&amp;pb="); >> document.write (document.phone.style.display.value); document.write ("'>save view</a>"); };...
38
by: Red Dragon | last post by:
I am self study C student. I got stuck in the program below on quadratic equation and will be most grateful if someone could help me to unravel the mystery. Why does the computer refuse to execute...
1
by: Tammy | last post by:
I am fairly new to asp and web development. I'm having a tough time with the htmltextwriter. I keep receiving an error that basically says 'object reference not set to instance of object. It sure...
6
by: Geoffrey S. Knauth | last post by:
It's been a while since I programmed in C++, and the language sure has changed. Usually I can figure out why something no longer compiles, but this time I'm stumped. A friend has a problem he...
0
by: jereme.goblue | last post by:
The web page at http://www.rossowinspections.com/ has an issue with the left menu. The left menu has 7 links. One of the links doesn't work. Using Firefox 1.5 the Fees link isn't a clickable...
3
by: TCB | last post by:
I am getting this error while tryin to read the contents of a Web page so I can send them in an email: "Too many automatic redirections were attempted." This is the code I am using Private...
1
by: incognito | last post by:
Hello I recently started up my own website and aquired an affiliates directory script. Where webmasters can add thier site to my directory and visitors can rate the sites listed. All has been going...
3
by: DVir | last post by:
I am having problem with IE. This is the code that I am using, and it works good in every browser except in IE. If somebody can help PLEASE: <script language="Javascript" type="text/javascript">...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.