Re: Interesting math



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



Relevant Pages

  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... precision numbers in oracle, you've got 38 decimal digits to play ... and with minimal coaxing perl will handle them as ... digits from a 32 bit floating point number - I'll go out on a limb ... and hazard that one can expect 12 or so digits from a 64 bit floating ...
    (perl.dbi.users)
  • Re: Linear Algebra Challenge
    ... Since I'm using floating point, so I'll never be able to calculate one ... floating point math set to 99 digits. ... As close as I'm willing to wait if I use arbitrary precision. ... This mode is fast; when you select arbitry ...
    (comp.sys.hp48)
  • Re: converting float to double
    ... >> insists that I read the stock prices as float. ... >> Since everywhere else the system uses double to hold these prices, ... A 64 bit integer will correctly model currency to 18 digits (with ... calcuations in 110 digits of precision (so that things like interest ...
    (comp.lang.c)
  • Re: Interesting math
    ... Floating point number represents a real number with 6 digits precision. ... Floating point numbers are denoted by the keyword float. ...
    (alt.usage.english)
  • Re: float vs. double?
    ... There have been repeated myths that float is faster than double. ... In antique machines, the ... Note that the floating-point ALU of Intel chips supports an 80-bit floating point number, ... is different precision being stored? ...
    (microsoft.public.vc.mfc)