Re: Interesting math
- From: blmblm@xxxxxxxxxxxxx <blmblm@xxxxxxxxxxxxx>
- Date: 11 Jul 2007 21:06:37 GMT
In article <domdneB82fFzUwnbnZ2dnUVZ_ragnZ2d@xxxxxxxxxxxx>,
Purl Gurl <purlgurl@xxxxxxxxxxxx> wrote:
blmblm wrote:
Purl Gurl wrote:
blmblm wrote:
What is a "C Float Number"? The criterion seems to
have something to do with number of significant figures.
What's the point?
A C Float Number must have six or more significant digits
after a decimal point. Six or more, no exceptions. Research
and read about C Float Numbers and programming in C language.
This has to do with syntax and declarations, actually more to
do with memory allotment for variable declarations.
Nonsense. I'm reasonably fluent in C, and I have never heard of
this restriction, nor can I imagine what (1) the number of digits
in the text representation of the number in program source code
has to do with (2) memory allotment.
Nonsense?
----
Floating point number represents a real number with 6 digits precision.
Floating point numbers are denoted by the keyword float. When the accuracy
of the floating point number is insufficient, we can use the double to
define the number. The double is same as float but with longer precision.
To extend the precision further we can use long double which consumes 80
bits of memory space.
http://www.exforsys.com/tutorials/c-language/c-programming-language-data-types.html
Nonsense.
I am unable to find in the above-cited Web page any support
for the curious notion that floating-point constants in
program source code must be written with exactly six digits
following a decimal point. Perhaps that wasn't what you meant?
though this curious notion does seem consistent both with
your Perl code and what you said in that long-ago thread in
comp.lang.perl.misc. (By the way, I read back through that
thread, and the person who seems the most confused is --
guess who.)
----
Floating point Types
float Single precision floating point number typical size...Single
precision
equates to about 6 digits of precision and double is about 15
digits of precision.
...main reason to use float is to save memory if many numbers need
to be stored.
http://www.mycplus.com/tutorial.asp?TID=304
I do not think these words mean what you (seem to) think they
mean .... Notice also the use of "about" in the quoted text.
----
FLOAT:
Macintosh Metrowerks CW (Default) - 6 digits
Linux on a PC - 6 digits
IBM PC Windows XP and Windows NT - 6 digits
ANSI C Minimum - 6 digits
http://www.samspublishing.com/articles/article.asp?p=350580&seqNum=4&rl=1
And *this* URL takes me to a page that contains examples that
directly contradict the curious notion. Go to the page and
search for "Floating-Point Constants".
----
Floating Point Numbers
Another commonly used format specification follows the form %14.6f
(the 14 and 6 could be replaced by any numbers). This specifies that
the number should be printed with exactly 6 digits after the decimal
point, and should occupy at least 14 characters in total; padding
consists of spaces added to the left.
http://rabbit.eng.miami.edu/info/functions/stdio.html
This describes conversions from internal floating-point format to
text. What does that have to do with conversions going the other
way? (Yes, the cited page does also describe scanf, but again
not in terms consistent with the curious notion.)
----
http://sig.biostr.washington.edu/share/skandha4/html/slisp_192.html
Totally irrelevant as far as I can tell.
http://en.wikipedia.org/wiki/IEEE_754
http://en.wikipedia.org/wiki/Floating_point
Interesting, but also totally irrelevant.
I notice that Evan Kirshenbaum has written an informative reply.
More in response to that.
--
Decline To State
(But the e-mail address in the header should work.)
.
- Follow-Ups:
- Re: Interesting math
- From: Purl Gurl
- Re: Interesting math
- References:
- Interesting math
- From: Skitt
- Re: Interesting math
- From: Purl Gurl
- Re: Interesting math
- From: blmblm
- Re: Interesting math
- From: Purl Gurl
- Interesting math
- Prev by Date: Re: Strictly Standard English
- Next by Date: Re: Kissing Explained
- Previous by thread: Re: Interesting math
- Next by thread: Re: Interesting math
- Index(es):
Relevant Pages
|