PHP

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Calculations and exponents in languages

    1 answers - 544 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    28/06/06, tg-php (AT) gryffyndevelopment (DOT) com
    <tg-php (AT) gryffyndevelopment (DOT) comwrote:
    Huh thanks for the illustration Robin. Can't say that I did much with exponents when I've played around with perl or python or C and never worked with Java. You've expanded my view.
    , now what languages D use ^ for exponents?
    The only one I can think of off the top of my head is BASIC.
    Even Bash uses ^ as an xor operator:
    $ echo $(( 7 ^ 2 ))
    5
    $ echo $(( 7 ** 2 ))
    49
    -robin
  • No.1 | | 935 bytes | |

    Algol used ^

    More common, historically, is the use of ** as the exponentiation
    operator: Fortran, PL/I, perl, python

    Curiously, many modern languages -- inexplicably -- don't have an
    exponentiation operator: C, Java, Javascript, PHP

    John Gunther

    Robin Vickery wrote:
    28/06/06, tg-php (AT) gryffyndevelopment (DOT) com
    <tg-php (AT) gryffyndevelopment (DOT) comwrote:

    >Huh thanks for the illustration Robin. Can't say that I did much
    >with exponents when I've played around with perl or python or C and
    >never worked with Java. You've expanded my view.
    >>

    >, now what languages D use ^ for exponents?


    The only one I can think of off the top of my head is BASIC.

    Even Bash uses ^ as an xor operator:

    $ echo $(( 7 ^ 2 ))
    5
    $ echo $(( 7 ** 2 ))
    49
    -robin

Re: Calculations and exponents in languages


max 4000 letters.
Your nickname that display:
In order to stop the spam: 9 + 8 =
QUESTION ON "PHP"

EMSDN.COM