[Solved] How would I represent mathematical expressions in Java


Judging by your comment on a previous answer, it sounds like you’re trying to write the expression like this:

8.0 x 104

The 4 is in superscript – and unless the editor has support for putting text in super/subscript you can’t do it without copying and pasting the unicode character representation for superscript 4. (Note, copying the 4 from this example will not give you a superscript 4.)

In HTML (which is how I wrote this here) you would use the <sup> tag.

Generally, when powers are written in plain text, the ^ symbol is used to denote that it is a power, like this:

8.0 x 10^4

1

solved How would I represent mathematical expressions in Java