Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old March 24th, 2007, 05:15 AM
DirtyHarry
Guest
 
Posts: n/a
Default Why float is called as 'float', not 'real'?

Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...

Is there any particular reason to call 'float' instead of 'real'?

  #2  
Old March 24th, 2007, 05:55 AM
ma740988
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

On Mar 24, 12:13 am, "DirtyHarry" <kim20...@gmail.comwrote:
Quote:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...
>
Is there any particular reason to call 'float' instead of 'real'?
What you call 'double' - real32?

I'm certainly not well versed in the history of the languages ( I
suspect this dates back to C ) nonetheless, Fortran is the only
language I've encountered that used REAL. Granted, rational,
irrational etc - numbers are approximations of real arithmetic, I
suspect machine precision limitations plays an important role. Beyond
that I'm unsure what the impetus is.

  #3  
Old March 24th, 2007, 05:55 AM
Gianni Mariani
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

DirtyHarry wrote:
Quote:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...
>
Is there any particular reason to call 'float' instead of 'real'?
float stands for "floating point" as opposed to "fixed point". It is a
more accurate description than "real" since not all real numbers are
representable by a floating point number.
  #4  
Old March 24th, 2007, 06:05 AM
Jim Langston
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

"DirtyHarry" <kim20026@gmail.comwrote in message
news:1174709605.314071.324610@e65g2000hsc.googlegr oups.com...
Quote:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...
>
Is there any particular reason to call 'float' instead of 'real'?
So if we call a float a real, does that mean we have to call an int a fake?
float is more descriptive I believe.


  #5  
Old March 24th, 2007, 09:05 AM
Juha Nieminen
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

DirtyHarry wrote:
Quote:
Is there any particular reason to call 'float' instead of 'real'?
Because a 'float' is not a real number, but a floating point number.
There's a big difference.
  #6  
Old March 24th, 2007, 12:55 PM
SasQ
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

Dnia Fri, 23 Mar 2007 21:49:04 -0700, ma740988 napisał(a):
Quote:
Fortran is the only language I've encountered that used REAL.
Pascal used it too ;)
And it's probably the language used formerly by OP, causing
his confusion upon encountering 'float' ;J

--
SasQ
  #7  
Old March 24th, 2007, 01:45 PM
Rolf Magnus
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

Jim Langston wrote:
Quote:
"DirtyHarry" <kim20026@gmail.comwrote in message
news:1174709605.314071.324610@e65g2000hsc.googlegr oups.com...
Quote:
>Good day everyone. This sounds like a stupid question, but I became
>just curious yesterday, and I looked up several textbooks. However, no
>textbooks on computer language (that I have ) mentioned this. So I am
>asking to you, gurus...
>>
>Is there any particular reason to call 'float' instead of 'real'?
>
So if we call a float a real, does that mean we have to call an int a
fake?
I guess the OP is talking about the mathematical term as in "real number",
not the opposite of "fake".
Quote:
float is more descriptive I believe.
Agreed.

  #8  
Old March 24th, 2007, 01:55 PM
Rolf Magnus
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

DirtyHarry wrote:
Quote:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...
>
Is there any particular reason to call 'float' instead of 'real'?
Counter question: Is there any particular reason to call it 'real' instead
of 'float'?

  #9  
Old March 24th, 2007, 02:05 PM
Pete Becker
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

DirtyHarry wrote:
Quote:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...
>
Is there any particular reason to call 'float' instead of 'real'?
>
float is short for "floating-point." double is short for
double-precision floating point.

--

-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
  #10  
Old March 24th, 2007, 05:05 PM
ma740988
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

On Mar 24, 8:43 am, Rolf Magnus <ramag...@t-online.dewrote:
Quote:
Counter question: Is there any particular reason to call it 'real' instead
of 'float'?
I suspect the OP's thought process reflects what I - perhaps all of us
- was taught in a mathematical sense. In that regard, I'd talk in
terms of integers, real numbers and complex numbers. These are terms
everyone understands including C / C++ programmers. I had a similar
question hen I first encountered 'floats and double'. I'd like to
believe Real32 and Real64 would suffice, but considering C/C++ has
been around for sometime, you chalk it up to 'it is what it is' and
move on.

In the end, the OP could always - worse case - typedef the float/
double to what he/she considers a more meaningful description. That's
the beauty of the language.



  #11  
Old March 24th, 2007, 05:15 PM
Giff
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

Gianni Mariani ha scritto:

It is a
Quote:
more accurate description than "real" since not all real numbers are
representable by a floating point number.
neither are all the integers by int...
  #12  
Old March 24th, 2007, 06:25 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

Giff wrote:
Quote:
Gianni Mariani ha scritto:
>
It is a
Quote:
>more accurate description than "real" since not all real numbers are
>representable by a floating point number.
>
neither are all the integers by int...
All integers from INT_MIN to INT_MAX are. For 'float' that is not so.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  #13  
Old March 25th, 2007, 05:25 AM
Greg Herlihy
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

On Mar 24, 8:58 am, "ma740988" <ma740...@gmail.comwrote:
Quote:
On Mar 24, 8:43 am, Rolf Magnus <ramag...@t-online.dewrote:
>
Quote:
Counter question: Is there any particular reason to call it 'real' instead
of 'float'?
>
I suspect the OP's thought process reflects what I - perhaps all of us
- was taught in a mathematical sense. In that regard, I'd talk in
terms of integers, real numbers and complex numbers. These are terms
everyone understands including C / C++ programmers. I had a similar
question hen I first encountered 'floats and double'. I'd like to
believe Real32 and Real64 would suffice, but considering C/C++ has
been around for sometime, you chalk it up to 'it is what it is' and
move on.
A "real" type would have to be able to represent irrational numbers -
which floating point numbers cannot represent, since all floating
point numbers (except for infinity) are rational.
Quote:
In the end, the OP could always - worse case - typedef the float/
double to what he/she considers a more meaningful description. That's
the beauty of the language.
Defining a "real" typedef for float is not going to change the types
of numbers that a float can represent. So the typedef would not change
the fact that a float does not represent real numbers, but the "real"
name could mislead anyone who sees it - into believing that it does.

Greg

  #14  
Old March 25th, 2007, 05:25 AM
Alf P. Steinbach
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

* Greg Herlihy:
Quote:
On Mar 24, 8:58 am, "ma740988" <ma740...@gmail.comwrote:
Quote:
>On Mar 24, 8:43 am, Rolf Magnus <ramag...@t-online.dewrote:
>>
Quote:
>>Counter question: Is there any particular reason to call it 'real' instead
>>of 'float'?
>I suspect the OP's thought process reflects what I - perhaps all of us
>- was taught in a mathematical sense. In that regard, I'd talk in
>terms of integers, real numbers and complex numbers. These are terms
>everyone understands including C / C++ programmers. I had a similar
>question hen I first encountered 'floats and double'. I'd like to
>believe Real32 and Real64 would suffice, but considering C/C++ has
>been around for sometime, you chalk it up to 'it is what it is' and
>move on.
>
A "real" type would have to be able to represent irrational numbers -
which floating point numbers cannot represent, since all floating
point numbers (except for infinity) are rational.
>
Quote:
>In the end, the OP could always - worse case - typedef the float/
>double to what he/she considers a more meaningful description. That's
>the beauty of the language.
>
Defining a "real" typedef for float is not going to change the types
of numbers that a float can represent. So the typedef would not change
the fact that a float does not represent real numbers, but the "real"
name could mislead anyone who sees it - into believing that it does.
Well. 'int' is rather misleading too. Come to think of it, is there
any type name in a programming language that isn't misleading, when one
thinks of it with mathematical-inspired expectations?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
  #15  
Old March 25th, 2007, 05:55 PM
osmium
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

"DirtyHarry" worte:
Quote:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned this. So I am
asking to you, gurus...
>
Is there any particular reason to call 'float' instead of 'real'?
My guess is that it originated with the hardware designers. It seemed
descriptive so others that came along just adopted it.
My theory seems to be supported by this link.

http://www.oars.utk.edu/math_archive...pr99/0144.html


  #16  
Old March 27th, 2007, 05:45 AM
DirtyHarry
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

Thanks, everyone... Finally I got out of clouds...


  #17  
Old March 28th, 2007, 07:25 PM
SasQ
Guest
 
Posts: n/a
Default Re: Why float is called as 'float', not 'real'?

Dnia Fri, 23 Mar 2007 21:59:12 -0700, Jim Langston napisał(a):
Quote:
So if we call a float a real, does that mean we have to
call an int a fake?
unreal :>

--
SasQ
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.