This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You need to ask a more specific question. How do you want to display this information? Are you simply interested in calculating the value of x squared or x cubed and then "displaying" it? Or are you writing some kind of math software that needs to display these in an equation of some sort? Are you writing a text-based program? Or are you developing a GUI? These questions should help give you ideas. In short, we need more details about your specific problem in order to help much. Keep coding! Layne
Text-based output is very limited. That is why something like x^4 is commonly used. As mentioned Unicode can give you more options, but it is still limited by the display capabilities of the platform you are running on. In order to produce output similar to that in a text book, you will probably have to use some kind of graphical display that can manipulate the font properties.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: representing exponents like x to the power 2 3 and so on