?
Solved

[noob][c++]  enum + float

Posted on 2007-11-15
7
Medium Priority
?
589 Views
Last Modified: 2007-11-15
precision and rounding and maybe other settings for float type needs to be adjusted

is enum what I should use?

I checked c++ in a nutshell by oreilly, but I can't seem to find any thing from it about enum.


how do I do this?
0
Comment
Question by:Troudeloup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20294726
could you detail more your problem?
0
 

Author Comment

by:Troudeloup
ID: 20295364
yeah.


float a;
a = 13000075

cout << a;


it output this


1.30001e+007
0
 

Author Comment

by:Troudeloup
ID: 20295460
or more precisely,


what is enum and how do I use it?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20295475
you need to learn about STL output manipulators:

cout.precision(0);
cout <<   fixed    << a  << endl;

There are lots of manipulators, have a look to:
http://www.cplusplus.com/reference/iostream/manipulators/
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20295483
I don't figure out how enumerations can help you in this issue.
0
 

Author Comment

by:Troudeloup
ID: 20295497
are you saying that it's cout that chop off the parts, not the float type itself?
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 20295517
float value remains untouched. It is just a presentation matter.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question