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'? 16 10865
On Mar 24, 12:13 am, "DirtyHarry " <kim20...@gmail .comwrote:
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.
DirtyHarry wrote:
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.
"DirtyHarry " <ki******@gmail .comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
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.
DirtyHarry wrote:
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.
Dnia Fri, 23 Mar 2007 21:49:04 -0700, ma740988 napisa³(a):
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
Jim Langston wrote:
"DirtyHarry " <ki******@gmail .comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
>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".
float is more descriptive I believe.
Agreed.
DirtyHarry wrote:
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'?
DirtyHarry wrote:
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)
On Mar 24, 8:43 am, Rolf Magnus <ramag...@t-online.dewrote:
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Marcus |
last post by:
I have a column in a MySQL database called price and of type FLOAT(8,2).
I then insert two rows into my table, one where price = 100.00 and one
where price = 100.01, and then try to find these rows:
query 1:
SELECT price
FROM table
WHERE price = 100.00
|
by: Peter Scheurer |
last post by:
Hi,
we found some strange behavior when operating with floats and round().
The following simplified statement reproduces the problem.
select 6.56 - round(convert(float, 6.56), 2)
from sysusers where name = 'public';
===========
-8.88178419
|
by: Mark |
last post by:
What are the best .NET datatypes to handle SQL Server's Float and Real
datatypes? I'd like to avoid using the SQL Server specific datatypes like
SqlInt32 or similar.
Thanks in advance.
-Mark
|
by: bearophileHUGS |
last post by:
sys.maxint gives the largest positive integer supported by Python's
regular integer type. But maybe such attribute, with few others (they
can be called min and max) can be given to int type itself.
D is a very nice language, that I hope to see more used. It is copying
lot of things from Python. D Floating point values have some
proprieties:
http://www.digitalmars.com/d/property.html
Properties for Floating Point Types:
|
by: Dilip |
last post by:
Recently in our code, I ran into a situation where were stuffing a
float inside a double. The precision was extended automatically
because of that. To make a long story short, this caused problems
elsewhere in another part of the system where that figure was used for
some calculation and some eventual truncation led to the system going
haywire. So my question is, given this code:
int main()
{
float f = 59.89F;
| |
by: JDT |
last post by:
Hi,
It seems that using floats as the first tupelo for an STL map (shown
below) can cause problems but I don't remember what the problems were.
Is it common practice to use a structure like below? I would appreciate
if you can share your experience using such a structure. Thanks.
std::map<float, intm;
JD
|
by: Toe001 |
last post by:
In a program for use with a micro, I have a variable of type float (real number) and wish to save it to EEPROM. I have a routine which writes a byte at a time to EEPROM at the location (address) I designate.
The problem comes in that I do not know how the variable (type float) is stored. I do know that a variable of type floats is a 32 bit value in the compiler I am using.
Is it as simple as writing each of the 4 bytes of the float (real),...
|
by: d major |
last post by:
I was very puzzled about the conversion between float and long, I
cann't understand why a long val can convert to a float, as the below
codes show:
typedef unsigned long u_long;
float val = 3.14159;
u_long nw_val = *((u_long *) &val);
than the nw_val equal to 1078530000, I made such conversion:
float d_val = *((float*)&nw_val);
|
by: Bill Reid |
last post by:
I just noticed that my "improved" version of sscanf() doesn't assign
floating point numbers properly if the variable assigned to is declared
as a "float" rather than a "double". (This never cropped up before, since
I rarely use "float"s for anything, and hardly ever use the function for
floating-point numbers in the first place; I just was messing around
testing it for all cases and noticed a problem.)
Anyway, it is declared and I...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |