TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: ROBERT DAVIES
date: 1998-01-21 14:57:00
subject: I do not under srand this can anyone enl14:57:1401/21/98

Hello all,
I'm new to C++ and find that there are parts in the program below which I 
don't understand. If you have a look at lines nine and ten
cout << 1.e3        << endl; //  1000
cout << 1.e-3       << endl; //  0.001
Does 1.e3 mean one multiplied by a thousand, and 1.e-3 mean one multiplied by 
minus a thousand?
// Program 2.3
// Floating Points Constants
#include 
void main ()
{                                                //  output
cout << 1.                   << endl; //  1
cout << -1.                  << endl; //  -1
cout << 123.              << endl; //  123
cout << 0.123            << endl; //  0.123
cout << 1.e3              << endl; //  1000
cout << 1.e-3             << endl; //  0.001
cout << 1.23e2           << endl; //  123
cout << 123.e-2          << endl; //  1.23
cout << 0.123456789 << endl; //  0.1234567
cout << 123456789.   << endl; //  1.234567e+8
cout << 1./2.       << endl; //  0.5
cout << 1./2        << endl; //  0.5
cout << 1 /2.       << endl; //  0.5
cout << 1 /2        << endl; //  0
}
As you can see it is a very basic program but I would like to understand it 
before I go any further so if you can help me please  do.
Thanks in advance for any comments
Bye for now
Yours Spasm Robert.
---
---------------
* Origin: ROBERTS POINT (2:254/60.22)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.