What is the symbol used for exponentiation in different programming languages?

  • Thread starter Thread starter LightbulbSun
  • Start date Start date
  • Tags Tags
    Mean Symbol
Click For Summary
The symbol for exponentiation varies across programming languages, with the caret (^) commonly used in BASIC and some calculators, while FORTRAN employs double asterisks (**). This notation is not standard in mathematics or physics but is widely recognized online when superscripts cannot be used. In Python, exponentiation is represented by the double asterisk (**), aligning with FORTRAN. Some languages may use the caret for other operations, such as exclusive or. Overall, while there is no universal symbol, the usage of ^ and ** for exponentiation is well established in programming contexts.
LightbulbSun
Messages
64
Reaction score
2
Example:

Acceleration= distance / time ^ 2
 
Mathematics news on Phys.org
In that context it presumably means "to the power of".
 
nicksauce said:
In that context it presumably means "to the power of".

Thanks. :smile:
 
It is NOT a standard mathematics (or physics) symbol but is used on the internet when you aren't able to write superscripts.
 
HallsofIvy said:
It is NOT a standard mathematics (or physics) symbol but is used on the internet when you aren't able to write superscripts.

It's also used on some calculators, and some spreadsheet programs like Microsoft Excel.
 
Math Is Hard said:
It's also used on some calculators, and some spreadsheet programs like Microsoft Excel.
And in TeX and in Matlab and in Mathematica and ...

However, in some computer languages it means exclusive or.
 
HallsofIvy said:
It is NOT a standard mathematics (or physics) symbol but is used on the internet when you aren't able to write superscripts.

It's well enough institutionalized you could call it standard notation. No, Newton and Euler wouldn't know what it meant, but anyone who's ever used a hand calculator would.
 
The ^ notation for exponentiation came out of BASIC. FORTRAN uses ** for the same purpose, but most other high-level programming languages that I know of don't have a corresponding operator.
 
Mark44 said:
The ^ notation for exponentiation came out of BASIC. FORTRAN uses ** for the same purpose, but most other high-level programming languages that I know of don't have a corresponding operator.

Python uses ** for exponentiation.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
14K