aspose file tools*
The moose likes Java in General and the fly likes representing exponents like x to the power 2 3 and so on Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "representing exponents like x to the power 2 3 and so on" Watch "representing exponents like x to the power 2 3 and so on" New topic
Author

representing exponents like x to the power 2 3 and so on

DHARMENDRA perisetla
Greenhorn

Joined: Feb 10, 2003
Posts: 3
I want display x square x cube and so on
can some one help me
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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


Java API Documentation
The Java Tutorial
DHARMENDRA perisetla
Greenhorn

Joined: Feb 10, 2003
Posts: 3
I want to display the equation in a text based program.It is a kind of Math software where u have to display the equation.
displaying like this (x^4)is not what i need.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
So are you asking how to display a superscript?


"JavaRanch, where the deer and the Certified play" - David O'Meara
DHARMENDRA perisetla
Greenhorn

Joined: Feb 10, 2003
Posts: 3
yes i want to display superscript
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You could use Unicode characters ( http://www.unicode.org/charts/PDF/U2070.pdf )but I don't think they will display properly on the console.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: representing exponents like x to the power 2 3 and so on