Solved

[noob][c++]  enum + float

Posted on 2007-11-15
7
581 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
Industry Leaders: 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 500 total points
ID: 20295517
float value remains untouched. It is just a presentation matter.
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
withoutString  challenge 40 223
WPF - External data binding to controls inside a UserControl 2 93
SQL400 max size 5 118
Work with App store 7 121
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

734 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