Complex Numbers Exponential - in Programming Languages

In Programming Languages

The superscript notation xy is convenient in handwriting but inconvenient for typewriters and computer terminals that align the baselines of all characters on each line. Many programming languages have alternate ways of expressing exponentiation that do not use superscripts:

  • x ↑ y: Algol, Commodore BASIC
  • x ^ y: BASIC, J, MATLAB, R, Microsoft Excel, TeX (and its derivatives), TI-BASIC, bc (for integer exponents), Haskell (for nonnegative integer exponents), Lua, ASP and most computer algebra systems
  • x ^^ y: Haskell (for fractional base, integer exponents), D
  • x ** y: Ada, Bash, COBOL, Fortran, FoxPro, Gnuplot, OCaml, Perl, PL/I, Python, Rexx, Ruby, SAS, Seed7, Tcl, ABAP, Haskell (for floating-point exponents), Turing, VHDL
  • x⋆y: APL

Many programming languages lack syntactic support for exponentiation, but provide library functions.

In Bash, C, C++, C#, Java, JavaScript, Perl, PHP, Python and Ruby, the symbol ^ represents bitwise XOR. In Pascal, it represents indirection. In OCaml and Standard ML, it represents string concatenation.

Read more about this topic:  Complex Numbers Exponential

Famous quotes containing the words programming and/or languages:

    If there is a price to pay for the privilege of spending the early years of child rearing in the driver’s seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.
    Melinda M. Marshall (20th century)

    I am always sorry when any language is lost, because languages are the pedigree of nations.
    Samuel Johnson (1709–1784)