<p>Having had very little math(s) education I'm trying to bring myself up to speed for university, which currently involves teaching myself the times tables, where <code>X</code> is frequently used as the operator for multiplication (at least here in the UK). As far as I know this is the oldest multiplication symbol attested to in the Western world. I also know that beyond high-school level and especially in academia, the interpunct (<code>·</code>) is more common, and was originally advocated by Leibniz in a letter to Bernoulli:</p>
<blockquote>
<p>&quot;I do not like X as a symbol for multiplication, as it is easily confounded with x; ... often I simply relate two quantities by an interposed dot and indicate multiplication by ZC · LM.&quot;</p>
</blockquote>
<p>Apparently it's also relatively common to use a <a href="https://math.stackexchange.com/questions/2967633/meaning-of-period-symbol-in-this-context">simple full-stop</a>, and I'm sure there are even more operators in use beyond these three.</p>
<p>Why then, given all these common and more intuitive options, do so many programming languages use an entirely new symbol (<code>*</code>) to indicate multiplication?</p>
<p><strong>Which language first used the asterisk for multiplication, and what was the reasoning for doing so?</strong></p>

<syntax><language-design><operators><history>
Why do programming languages use the asterisk * for multiplication?
CC BY-SA 4.0
2023-09-23T18:41:25.447Z
**Comments have been [moved to chat](https://chat.stackexchange.com/rooms/148705/discussion-on-question-by-hashim-aziz-why-do-programming-languages-use-the-aster); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed.
Michael Homer
CC BY-SA 4.0
2023-10-15T12:07:27.493Z
As a math educator for 15 years, I have always used asterisk, *, for multiplication.  A.The principal reason being a student or significant percentage of students don't see the dot on the whiteboard, formerly chalkboards.  Even now this important on video camera as I teach remotely and my students' internet is sporadic.  B. As mentioned otherwise typing the raised dot, $\cdot$, on a standard keyboard is difficult.  C. And of course the decimal point is inappropriate because it is leads to confusion with a decimal point.
nickalh
CC BY-SA 4.0
2023-10-15T15:10:32.357Z
@nickalh × is a lot easier to write quickly and seems to be the most commonly understood by the general public, at least for the UK and possibly the US too.
Hashim Aziz
CC BY-SA 4.0
2024-03-23T08:33:04.197Z
Related: [Retrocomputing: Why do keyboards have an asterisk key?](https://retrocomputing.stackexchange.com/questions/16051/why-do-keyboards-have-an-asterisk-key)
smci
<p>I believe the first language to use <code>*</code> for multiplication was FORTRAN, in its <a href="https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf" rel="noreferrer">original specification</a> in 1956 (with earlier drafts).</p>
<p>None of the other symbols you suggest except the full stop were available in the character set in use on the machines, which predated the high-level language design and was taken as a given. It's only a relatively recent development that these other symbols are all in sufficiently widespread encodings together that choosing between them is an option.</p>
<p>However, in 1954 the FORTRAN authors <em>were</em> <a href="https://www.softwarepreservation.org/projects/FORTRAN/paper/Backus%20and%20Herrick%20-%20Speedcoding%20-%20ONR%201954.pdf" rel="noreferrer">considering</a> that a programmer</p>
<blockquote>
<p>would like to write <span class="math-container">$\sum a_{ij} \cdot b_{jk}$</span> instead of the fairly involved set of instructions corresponding to this expression</p>
</blockquote>
<p>as part of the work leading into FORTRAN. Clearly <em>none</em> of this made it into the language in that form: the symbols and subscripting just weren't feasible on the machines of the time, but <code>X + Y</code> also considered did, along with <code>X * Y</code>.</p>
<p>This was all for a punch-card system on the IBM 704, which used BCD encoding with 48 total code points. In some respects the assignment of symbols to codes there is arbitrary, but encodings did correspond to real physical hardware for printing and input. <code>*</code> is one of the few available characters without a more obvious mathematical meaning and has <em>some</em> resemblence to both × and ·, so it's not an unreasonable choice. Subsequent languages have inherited this convention, often via ALGOL or BASIC.</p>
<p>Similarly, &quot;keyboard&quot; symbols have a significant advantage over others. <code>*</code> was present on ordinary typewriters as a marker, and no standard layout has either of the others now. It also made its way into ASCII for the same reason. Much of this is historical contingency, rather than an overarching design, but once the symbol is in use then there is also value in consistency, which reinforces making it available, which reinforces using it.</p>
<hr />
<p><sub>Applied Science Division and Programming Research Dept, International Business Machines Corporation. 1956.  <a href="https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf" rel="noreferrer">FORTRAN Automatic Coding System for the IBM 704: Programmer's Reference Manual</a>. </sub></p>
<p><sub>Backus, John W. and Herrick, Harlan. 1954. <a href="https://www.softwarepreservation.org/projects/FORTRAN/paper/Backus%20and%20Herrick%20-%20Speedcoding%20-%20ONR%201954.pdf" rel="noreferrer">IBM 701 Speedcoding and other automatic programming systems</a>. In Proceedings of the Symposium on Automatic Programming for Digital Computers.</sub></p>

CC BY-SA 4.0
2023-09-20T22:57:25.477Z
2023-09-22T07:15:32.613Z
2023-09-22T07:15:32.613Z
Michael Homer
CC BY-SA 4.0
2023-09-21T08:14:54.887Z
This begs a follow-up question: why weren't any multiplication symbols included in character sets of early computers back the when computers were primarily a number crunching machines, not cat-pictures-watching-devices like today.
el.pescado - нет войне
CC BY-SA 4.0
2023-09-21T08:32:12.107Z
@el.pescado-нетвойне: I suggest asking on the retro-computing stackexchange site, there's quite a few experts there, and someone may actually have a good answer :)
Matthieu M.
CC BY-SA 4.0
2023-09-21T08:40:54.057Z
I think the short answer is that the original BCD encoding mapping was made for printing commercial text (e.g. on cheques or reports) and there wasn't an encoding made specifically *for* these computers until several years later when it had been proved to be useful. On the cards themselves it's a bit arbitrary and to see the actual symbols translated took a printer. [Retrocomputing.se] will probably give you a more comprehensive or more correct answer!
Michael Homer
CC BY-SA 4.0
2023-09-21T20:01:05.210Z
Early computers had no need for a character set that included mathematical operators because you didn't *write* mathematical expressions on the computer.  You either had to hand-compile your code into machine language, or used an assembly language ([or Speedcoding](https://en.wikipedia.org/wiki/Speedcoding)) with alphabetic mnemonics.  FORTRAN was the first mainstream programming language to use the math-like syntax with `+-*/()` etc. that's popular today.
dan04
CC BY-SA 4.0
2023-09-21T21:28:45.797Z
@el.pescado-нетвойне character sets were designed for *data* — initially, just numbers, then alphanumerics, then some punctuation that might be useful for printing in tables. The idea that code could be a kind of data that the computer manipulated came along later.
hobbs
CC BY-SA 4.0
2023-09-21T22:10:20.170Z
@el.pescado-нетвойне They did have multiplication. Not only was it on IBM's first computers (IBM 701 BCD), it dates to the [1950's punch cards](https://homepage.divms.uiowa.edu/~jones/cards/codes.html). Being business machines, the multiplication character was the commercial at, `@`. On an invoice, you'd write `WIDGETS   12 @ 1.50       18.00`.
user71659
CC BY-SA 4.0
2023-09-22T09:13:59.973Z
@user71659 I'd rather understand the @ sign here as literal 'at', like '12 [pieces] at 1.50 [each]', not as a multiplication as in '12 times 1.50', but I'm not a native speaker, so I might be wrong.
elzell
CC BY-SA 4.0
2023-09-22T16:55:00.080Z
@elzell Isn't "12 pieces at 1.50 each" a multiplication, ultimately?
Federico Poloni
CC BY-SA 4.0
2023-09-22T17:00:09.793Z
@el.pescado Early computers didn't have custom-made keyboards, but they typically reused electric typewriter and teleprinter hardware for input. https://en.wikipedia.org/wiki/Computer_keyboard#History  And those were not made for number crunching.
Federico Poloni
CC BY-SA 4.0
2023-09-23T10:56:41.827Z
@FedericoPoloni I'd argue that the word "at" in that context has a meaning which is in one way more general than multiplication, and in another way more specific. It does imply multiplication in this context, but more generally it implies a unit conversion, and more specifically here it is multiplication by a conversion rate (in this case, a rate of "dollars per widget"). Compare with "2 hours at 50km/h", where the second number is a rate for converting time into distance, but you can also say "100km at 50km/h" and then the word "at" implies division, not multiplication.
kaya3
CC BY-SA 4.0
2023-09-26T15:37:57.010Z
@FedericoPoloni: I think "@" might be viewed as part of a three-operand "ratio" operator, which multiplies one thing by a second and divides by a third.  On many architectures, this could be a useful construct, and one for which IIRC Niklaus Wirth (but maybe it was Donald Knuth, or maybe both) advocated, since multiplication can often produce a double-width product, and division can often accept a double-width dividend, and the same register may be used for both.
supercat
CC BY-SA 4.0
2023-09-26T17:54:52.860Z
Amazing quote from the linked paper by Backus and Henrick, forecasting much higher-level languages: *"In fact a programmer might not be considered too unreasonable if he were willing only to produce the formulas for the numerical solution of his problem [...] and then demand that the machine produce the results for his problem. No doubt if he were too insistent next week about this sort of thing he would be subject to psychiatric observation. However, next year he might be taken more seriously."*
kaya3
<p>The other answers have covered the first uses of <code>*</code> in programming languages. To these I will add that the asterisk has been used as a symbol for multiplication in mathematics since as far back as 1668, by Swiss author Johan Heinrich Rahn and others (<a href="https://www.jstor.org/stable/2300111" rel="noreferrer">source</a>).</p>
<p>The division symbol <span class="math-container">$\div$</span> was also introduced at about the same time. Both are out of favour in modern formal mathematical notation, but saw widespread use in the past and are still used informally. So it makes sense that the asterisk would have been considered as an option for the multiplication operator in programming language syntax.</p>

CC BY-SA 4.0
2023-09-21T09:05:50.733Z
2023-09-21T09:05:50.733Z
kaya3
CC BY-SA 4.0
2023-09-21T13:26:36.103Z
Great observation; here's the primary source: https://www.google.com/books/edition/Teutsche_Algebra/ZJg_AAAAcAAJ?hl=en&gbpv=1&pg=PA7&printsec=frontcover
Xerxes
CC BY-SA 4.0
2023-09-23T09:49:21.193Z
Nice one - other answers explain why `×` and `·` are rare in programming languages, but this explains why `*` is the best alternative.
Toby Speight
<p>The fundamental reason is because neither true multiplication symbols <code>×</code> nor <code>⋅</code> were (or are) common on US keyboards. Using symbols that are not available on the keyboard is a far bigger problem than learning a new symbol for multiplication because after the trivial learning bump of associating <code>*</code> with multiplication it has no real cost whereas as needing characters off the keyboard or using a compound symbol (e.g. <code>.x.</code>) is a permanent slowdown.</p>
<p>The alternatives of <code>x</code> and <code>.</code> have major problems of their own. Using <code>x</code> would have caused parsing problems and stopped <code>x</code> being used as a variable. Using <code>.</code> would have been even worse as it clashes with the use of a full stop as the decimal separator that is normal among English speakers. There could, presumably, have been other symbols used but <code>*</code> is the one closest in appearance to the <code>×</code> and most other symbols already had established meanings that would have prevented their use.</p>
<p>FORTRAN seems to have been the first language to adopt the convention in <a href="https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf" rel="noreferrer">1956</a> with the manual simply stating &quot;The symbol * denotes multiplication&quot; without explanation. From there it seems to have become ubiquitous but given how other languages have changed almost every convention in one way or another, the origin in FORTRAN does not seem to me to be a particularly important justification for the usage and I think the reasons given at the start of this answer are more important than historical accident - ultimately <code>*</code> is simply the only good solution for English speakers, perhaps had German speakers driven the development of programming languages we'd all use <code>,</code> as the decimal separator and <code>.</code> as multiplication.</p>

CC BY-SA 4.0
2023-09-21T09:00:25.127Z
2023-09-21T12:56:16.640Z
2023-09-21T12:56:16.640Z
Jack Aidley
CC BY-SA 4.0
2023-09-21T09:51:18.843Z
And, speaking of German speakers, there would be a need for a separator of parameters in a function, and `*` would have been the only unused common symbol... Imagine calling `f(2* 3,4* 5.6);` instead of our `f(2, 3.4, 5*6);`
vsz
CC BY-SA 4.0
2023-09-21T12:25:19.830Z
If you use a Spanish keyboard then the middle dot character `·` is very common ;-)
Aaron F
CC BY-SA 4.0
2023-09-21T12:56:00.460Z
@AaronF: Indeed, many of the features of early programming languages (and inherited from them over time) are tied to their US-centric origins.
Jack Aidley
CC BY-SA 4.0
2023-09-21T13:00:47.210Z
@vsz Obviously this purely hypothetical, but the normal substitute for a comma separator is the semicolon in German (this is how German Excel formats CSV files btw). So it would more like be something like this `f(2; 3,4; 5.6)\ ` if Germans had designed C.
nanash1
CC BY-SA 4.0
2023-09-21T21:39:01.003Z
In most languages, allowing x to be both a variable name and an operator would not be impossible or impractical (except in FORTRAN).  It would complicate lexing & parsing, to be sure.  But since x as an operator is a binary operator, and x as a variable does not appear in the same positions as binary operators, I think it could be done.  But it'd uglify parsing for not much gain (in my opinion).
Wayne Conrad
CC BY-SA 4.0
2023-09-22T04:06:00.277Z
@WayneConrad, what makes you think that allowing `x` to be both a variable name and an operator would have been any more or less difficult in Fortran than in other languages?  From a language syntax perspective, I see pretty much the same ambiguities arising from across the spectrum of languages that both (i) use infix notation for arithmetic operations and (ii) allow the `x` character to appear in identifiers.
John Bollinger
CC BY-SA 4.0
2023-09-22T17:10:08.173Z
@JohnBollinger That's a mistake I made in that comment.  I thought that spaces were allowed in a variable name in e.g. FORTRAN IV, but they are not.  If spaces were allowed, then "X X X" could be "X times X", or it could be a variable named "XXX".  That's what I thought.  However, since spaces are not allowed, I was wrong about that.  FORTRAN would pose no special challenges for allowing "X" to denote multiplication.  Thank you for challenging my incorrect comment.
Wayne Conrad
CC BY-SA 4.0
2023-09-22T20:42:20.037Z
@WayneConrad: In FORTRAN, spaces are ignored in almost all contexts.  A statement like `DO 10 I=1.5` would create a variable named `DO10I` and set it to 1.5, while a statement `DO10I=1,5` would indicate the start of a loop that ended on line 10 and would iterate `I` from 1 to 5.
supercat
CC BY-SA 4.0
2023-09-22T20:45:26.770Z
@supercat In which case I was right to begin with, and my retraction was wrong.
Wayne Conrad
CC BY-SA 4.0
2023-09-22T20:48:12.917Z
@JohnBollinger: If X were a multiplication operator only when the left operand was a numeric literal, then it would be possible to interpret `THEVAR=3XFOO` as storing the product of 3 and `FOO` into `THEVAR`, but FORTRAN would have no way of determining whether `MYVAR=IT X 123` was storing the product of `IT` and the number 123, or a variable called `ITX123`.
supercat
CC BY-SA 4.0
2023-09-22T20:50:18.973Z
@WayneConrad: Precisely.  FORTRAN could probably without difficulty have used `.X.` in a manner analogous to its relational operators, or said that two expressions enclosed in parentheses which appear consecutive on either side of `X`, or without `X` for that matter, will be multiplied, but a letter `X` couldn't work in most contexts without punctuation.
supercat
CC BY-SA 4.0
2023-09-22T21:07:37.413Z
You seem to have taken my point backwards, @WayneConrad.  It is not that using `X` for multiplication could be OK in Fortran.  It's that it would be about as bad in any other language meeting the criteria I gave. Whereas fixed-form Fortran is unusual in making spaces insignificant most everywhere, most other languages make them *optional*.  So in C, for example, `thevar = foo * 3` means exactly the same thing as `thevar=foo*3`, but you could not achieve the same with `x` as the multiplication operator.
John Bollinger
CC BY-SA 4.0
2023-09-22T21:16:10.597Z
Yes, @supercat, `THEVAR=3XFOO` could conceivably be parsed as a multiplication in Fortran, but that's moot because you cannot ignore the case where the left operand is expressed as an identifier.  In any case, my point is primarily that other common languages would have approximately the same problem with `x` as a multiplication operator as Fortran would have, not so much about Fortran in particular.
John Bollinger
CC BY-SA 4.0
2023-09-22T21:25:22.963Z
@JohnBollinger: Quite a few languages would require a space between a keyword and an identifier that was next to it, so saying that `foo = bar x 3;` would apply the `x` operator would be no more problematic than saying (as Turbo Pascal does) than `foo := bar shr 3;` would apply the shifty-right operator.  What's funny is that pre-C89 C didn't ever require spaces before `+` or a `-` operator, but C89 added a requirement for a space after a hex constant that is congruent (mod 16) to 14.
supercat
<h1>FORTRAN I</h1>
<p>Based on some quick research, it appears that FORTRAN I was the first language to use <code>*</code> for multiplication. You can see a sample of FORTRAN I code here, which does appear to use <code>*</code>[1]</p>
<pre><code>READ 1, N, (A(1), 1 * l,N)
...
DO 20, I * 2,N
</code></pre>
<p>(copied out the best I can read).
There are also several examples around of FORTRAN II using <code>*</code> for multiplication[2], so it's really more up to whether FORTRAN I or II did it first.</p>
<p>You'd have to go back and either read the original FORTRAN tech reports or similar to figure out why they used <code>*</code>, but I'm assuming it's exactly because it looks similar to an interpunct.</p>
<p>As an anecdote, this would rather funnily indicate that using <code>*</code> for multiplication is quite literally as old as programming languages.</p>
<p>[1] <a href="http://www.paulgraham.com/history.html" rel="nofollow noreferrer">http://www.paulgraham.com/history.html</a></p>
<p>[2] <a href="https://github.com/scivision/fortran-II-examples/blob/main/funcs58.f" rel="nofollow noreferrer">https://github.com/scivision/fortran-II-examples/blob/main/funcs58.f</a>
eg:</p>
<pre><code>      term = -prevxp / presxp * y * term
</code></pre>

CC BY-SA 4.0
2023-09-20T22:51:44.933Z
2023-09-20T22:51:44.933Z
blueberry
CC BY-SA 4.0
2023-09-22T00:36:38.197Z
**Your [1] is not an asterisk and not multiplication.** Expand the gif (e.g. to fullscreen) and you'll see it's a closely-spaced equal sign `=` meaning assignment just like the one in `BIGA = A(1)`. And there's no lower-case ell `l` on machines of that vintage; the read list is `(A(I), I=1,N)`. (`I` is a variable, `1` is not.) A DO-statement _or_ I/O-implied-DO with no assignment wouldn't make any sense.
dave_thompson_085
<p>As discussed on <a href="https://retrocomputing.stackexchange.com/questions/16051/why-do-keyboards-have-an-asterisk-key">RetroComputing</a>, the asterisk character existed on IBM punch cards before electronic computers:</p>
<p>&quot;asterisk was added to IBM punch card codes 'somewhere around 1932' and was used for cheque protection. This was a 39-character set: alphanumerics, minus sign, ampersand, asterisk.&quot;</p>
<p>So, as discussed in other answers, it was appropriate, there was little other choice, and <a href="https://textfiles.meulie.net/bitsaved/Books/Mackenzie_CodedCharSets.pdf" rel="nofollow noreferrer"><em>it existed</em></a>.</p>

CC BY-SA 4.0
2023-10-06T05:27:08.043Z
2023-10-06T05:34:59.653Z
2023-10-06T05:34:59.653Z
david
<h1>Maybe FORTRAN, maybe MATH-MATIC</h1>
<p>FORTRAN's <a href="https://www.softwarepreservation.org/projects/FORTRAN/BackusEtAl-Preliminary%20Report-1954.pdf" rel="noreferrer">Preliminary Report in 1954</a> anticipated using the <code>×</code> symbol for multiplication (and <code>××</code> for exponentiation). The <a href="https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf" rel="noreferrer">1956 Programmer's Reference Manual</a>, which is the first manual for a working version, notes that the multiplication symbol is <code>*</code>.</p>
<p>In the 1978 <a href="https://www.softwarepreservation.org/projects/FORTRAN/paper/p165-backus.pdf" rel="noreferrer">HOPL-I history of FORTRAN</a>, John Backus claimed that the team were not influenced by any other languages as far as design goes, and specifically notes MATH-MATIC as a non-influence. Some syntax changes were made due to the 48 character set limit on punched cards (even the <code>&lt;</code> symbol wasn't available, hence <code>.LT.</code>), but the team felt that language design was the easy part, and focused their efforts on compilation.</p>
<p>So we can say that some time between November 1954 and October 1956, FORTRAN adopted <code>*</code> as the multiplication symbol, and they claimed not to be influenced by any other work.</p>
<p>So that's what was happening at IBM.</p>
<p>Back over at Remington Rand, Grace Hopper's A-2 language, released around 1951-2 for the UNIVAC I, used a text mnemonic for multiplication.</p>
<p>The next iteration, A-3, was renamed by Remington Rand as ARITH-MATIC, which used essentially the same mnemonic. However, the arithmetic translator layer AT-3, named MATH-MATIC, was developed around the same time, in 1955. The <a href="http://archive.computerhistory.org/resources/access/text/2016/06/102724614-05-01-acc.pdf" rel="noreferrer">preliminary manual was published in April 1957</a> and shows the <code>*</code> symbol for multiplication.</p>
<p>So it appears that FORTRAN and MATH-MATIC settled on this syntax independently. The implementations happened concurrently. FORTRAN shipped first, with AT-3 shipping less than a year later.</p>
<p>So while FORTRAN certainly shipped <code>*</code>-as-multiplication first, which one of the two designed it first and which one implemented it first... that's probably lost to history.</p>
<p>The Hopper family of languages became COBOL in 1959, and between them, FORTRAN and COBOL heavily influenced the arithmetic syntax of all subsequent languages.</p>

CC BY-SA 4.0
2023-09-21T02:54:19.993Z
2023-09-22T13:11:44.713Z
2023-09-22T13:11:44.713Z
Pseudonym
CC BY-SA 4.0
2023-09-21T13:26:03.787Z
"_UNIVAC I, used a text mnemonic for multiplication_" Not really relevant to the answer, but out of curiosity, what was that mnemonic?
TripeHound
CC BY-SA 4.0
2023-09-21T23:12:14.533Z
It was actually the name of the subroutine that was called: AA0 was addition, AS0 was subtraction, AM0 was for multiplication and AD0 was for division. You can think of many early programming languages, including A-2, as really being about calling subroutines with some flow control on top. Today we would call it "threaded code". High-level Formula/Arithmetic translation was one of the big new research areas. See: https://archive.org/details/sim_computers-and-people_1955-09_4_9/page/24/mode/2up?view=theater
Pseudonym
CC BY-SA 4.0
2023-09-22T08:54:12.600Z
Offtopic, but do you mean that > was available even though < was not??
Sneftel
CC BY-SA 4.0
2023-09-22T11:17:28.720Z
@Sneftel In the HOPL paper linked above, Jim Backus specifically notes that < wasn't available. I don't know anything more specific than that.
Pseudonym
CC BY-SA 4.0
2023-09-23T00:01:32.043Z
Of course it's John Backus. I knew that. Jim Backus was an actor. I shouldn't post while insufficiently caffeinated. Thank you to the kind editor.
Pseudonym
CC BY-SA 4.0
2024-04-03T01:21:38.203Z
@Sneftel https://homepage.cs.uiowa.edu/%7Ejones/cards/codes.html shows some of the early character sets used. If I'm reading it correctly, > was available while < was not. (But someone else can double-check against the other linked document on the history of Fortran, to make sure I'm looking at the correct character set.)
CoffeeTableEspresso
# Why do programming languages use the asterisk * for multiplication?
Posted by: username_0 on 2023-09-20
Having had very little math(s) education I'm trying to bring myself up to speed for university, which currently involves teaching myself the times tables, where `X` is frequently used as the operator for multiplication (at least here in the UK). As far as I know this is the oldest multiplication symbol attested to in the Western world. I also know that beyond high-school level and especially in academia, the interpunct (`·`) is more common, and was originally advocated by Leibniz in a letter to Bernoulli:

> "I do not like X as a symbol for multiplication, as it is easily confounded with x; ... often I simply relate two quantities by an interposed dot and indicate multiplication by ZC · LM."

Apparently it's also relatively common to use a [simple full-stop](https://math.stackexchange.com/questions/2967633/meaning-of-period-symbol-in-this-context), and I'm sure there are even more operators in use beyond these three.

Why then, given all these common and more intuitive options, do so many programming languages use an entirely new symbol (`*`) to indicate multiplication?

**Which language first used the asterisk for multiplication, and what was the reasoning for doing so?**
**Tags:** syntax language-design operators history
> **Comments:**
> **username_1**: **Comments have been [moved to chat](https://chat.stackexchange.com/rooms/148705/discussion-on-question-by-hashim-aziz-why-do-programming-languages-use-the-aster); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed.  
> **username_2**: As a math educator for 15 years, I have always used asterisk, *, for multiplication.  A.The principal reason being a student or significant percentage of students don't see the dot on the whiteboard, formerly chalkboards.  Even now this important on video camera as I teach remotely and my students' internet is sporadic.  B. As mentioned otherwise typing the raised dot, $\cdot$, on a standard keyboard is difficult.  C. And of course the decimal point is inappropriate because it is leads to confusion with a decimal point.  
> **username_0**: @nickalh × is a lot easier to write quickly and seems to be the most commonly understood by the general public, at least for the UK and possibly the US too.  
> **username_3**: Related: [Retrocomputing: Why do keyboards have an asterisk key?](https://retrocomputing.stackexchange.com/questions/16051/why-do-keyboards-have-an-asterisk-key)  
---
## 6 answers
### Answer by username_24 on 2023-09-21. Score: 35 | Accepted answer
# Maybe FORTRAN, maybe MATH-MATIC

FORTRAN's [Preliminary Report in 1954](https://www.softwarepreservation.org/projects/FORTRAN/BackusEtAl-Preliminary%20Report-1954.pdf) anticipated using the `×` symbol for multiplication (and `××` for exponentiation). The [1956 Programmer's Reference Manual](https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf), which is the first manual for a working version, notes that the multiplication symbol is `*`.

In the 1978 [HOPL-I history of FORTRAN](https://www.softwarepreservation.org/projects/FORTRAN/paper/p165-backus.pdf), John Backus claimed that the team were not influenced by any other languages as far as design goes, and specifically notes MATH-MATIC as a non-influence. Some syntax changes were made due to the 48 character set limit on punched cards (even the `<` symbol wasn't available, hence `.LT.`), but the team felt that language design was the easy part, and focused their efforts on compilation.

So we can say that some time between November 1954 and October 1956, FORTRAN adopted `*` as the multiplication symbol, and they claimed not to be influenced by any other work.

So that's what was happening at IBM.

Back over at Remington Rand, Grace Hopper's A-2 language, released around 1951-2 for the UNIVAC I, used a text mnemonic for multiplication.

The next iteration, A-3, was renamed by Remington Rand as ARITH-MATIC, which used essentially the same mnemonic. However, the arithmetic translator layer AT-3, named MATH-MATIC, was developed around the same time, in 1955. The [preliminary manual was published in April 1957](http://archive.computerhistory.org/resources/access/text/2016/06/102724614-05-01-acc.pdf) and shows the `*` symbol for multiplication.

So it appears that FORTRAN and MATH-MATIC settled on this syntax independently. The implementations happened concurrently. FORTRAN shipped first, with AT-3 shipping less than a year later.

So while FORTRAN certainly shipped `*`-as-multiplication first, which one of the two designed it first and which one implemented it first... that's probably lost to history.

The Hopper family of languages became COBOL in 1959, and between them, FORTRAN and COBOL heavily influenced the arithmetic syntax of all subsequent languages.
> **Comments:**
> **username_25** (2023-09-21): "_UNIVAC I, used a text mnemonic for multiplication_" Not really relevant to the answer, but out of curiosity, what was that mnemonic?  
> **username_24** (2023-09-21): It was actually the name of the subroutine that was called: AA0 was addition, AS0 was subtraction, AM0 was for multiplication and AD0 was for division. You can think of many early programming languages, including A-2, as really being about calling subroutines with some flow control on top. Today we would call it "threaded code". High-level Formula/Arithmetic translation was one of the big new research areas. See: https://archive.org/details/sim_computers-and-people_1955-09_4_9/page/24/mode/2up?view=theater  
> **username_26** (2023-09-22): Offtopic, but do you mean that > was available even though < was not??  
> **username_24** (2023-09-22): @Sneftel In the HOPL paper linked above, Jim Backus specifically notes that < wasn't available. I don't know anything more specific than that.  
> **username_24** (2023-09-23): Of course it's John Backus. I knew that. Jim Backus was an actor. I shouldn't post while insufficiently caffeinated. Thank you to the kind editor.  
> **username_27** (2024-04-03): @Sneftel https://homepage.cs.uiowa.edu/%7Ejones/cards/codes.html shows some of the early character sets used. If I'm reading it correctly, > was available while < was not. (But someone else can double-check against the other linked document on the history of Fortran, to make sure I'm looking at the correct character set.)  
---
### Answer by username_1 on 2023-09-20. Score: 46
I believe the first language to use `*` for multiplication was FORTRAN, in its [original specification](https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf) in 1956 (with earlier drafts).

None of the other symbols you suggest except the full stop were available in the character set in use on the machines, which predated the high-level language design and was taken as a given. It's only a relatively recent development that these other symbols are all in sufficiently widespread encodings together that choosing between them is an option.

However, in 1954 the FORTRAN authors *were* [considering](https://www.softwarepreservation.org/projects/FORTRAN/paper/Backus%20and%20Herrick%20-%20Speedcoding%20-%20ONR%201954.pdf) that a programmer

> would like to write $\sum a\_{ij} \cdot b\_{jk}$ instead of the fairly involved set of instructions corresponding to this expression

as part of the work leading into FORTRAN. Clearly *none* of this made it into the language in that form: the symbols and subscripting just weren't feasible on the machines of the time, but `X + Y` also considered did, along with `X * Y`.

This was all for a punch-card system on the IBM 704, which used BCD encoding with 48 total code points. In some respects the assignment of symbols to codes there is arbitrary, but encodings did correspond to real physical hardware for printing and input. `*` is one of the few available characters without a more obvious mathematical meaning and has *some* resemblence to both × and ·, so it's not an unreasonable choice. Subsequent languages have inherited this convention, often via ALGOL or BASIC.

Similarly, "keyboard" symbols have a significant advantage over others. `*` was present on ordinary typewriters as a marker, and no standard layout has either of the others now. It also made its way into ASCII for the same reason. Much of this is historical contingency, rather than an overarching design, but once the symbol is in use then there is also value in consistency, which reinforces making it available, which reinforces using it.

---

Applied Science Division and Programming Research Dept, International Business Machines Corporation. 1956. [FORTRAN Automatic Coding System for the IBM 704: Programmer's Reference Manual](https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf).

Backus, John W. and Herrick, Harlan. 1954. [IBM 701 Speedcoding and other automatic programming systems](https://www.softwarepreservation.org/projects/FORTRAN/paper/Backus%20and%20Herrick%20-%20Speedcoding%20-%20ONR%201954.pdf). In Proceedings of the Symposium on Automatic Programming for Digital Computers.
> **Comments:**
> **username_4** (2023-09-21): This begs a follow-up question: why weren't any multiplication symbols included in character sets of early computers back the when computers were primarily a number crunching machines, not cat-pictures-watching-devices like today.  
> **username_5** (2023-09-21): @el.pescado-нетвойне: I suggest asking on the retro-computing stackexchange site, there's quite a few experts there, and someone may actually have a good answer :)  
> **username_1** (2023-09-21): I think the short answer is that the original BCD encoding mapping was made for printing commercial text (e.g. on cheques or reports) and there wasn't an encoding made specifically *for* these computers until several years later when it had been proved to be useful. On the cards themselves it's a bit arbitrary and to see the actual symbols translated took a printer. [Retrocomputing.se] will probably give you a more comprehensive or more correct answer!  
> **username_6** (2023-09-21): Early computers had no need for a character set that included mathematical operators because you didn't *write* mathematical expressions on the computer.  You either had to hand-compile your code into machine language, or used an assembly language ([or Speedcoding](https://en.wikipedia.org/wiki/Speedcoding)) with alphabetic mnemonics.  FORTRAN was the first mainstream programming language to use the math-like syntax with `+-*/()` etc. that's popular today.  
> **username_7** (2023-09-21): @el.pescado-нетвойне character sets were designed for *data* — initially, just numbers, then alphanumerics, then some punctuation that might be useful for printing in tables. The idea that code could be a kind of data that the computer manipulated came along later.  
> **username_8** (2023-09-21): @el.pescado-нетвойне They did have multiplication. Not only was it on IBM's first computers (IBM 701 BCD), it dates to the [1950's punch cards](https://homepage.divms.uiowa.edu/~jones/cards/codes.html). Being business machines, the multiplication character was the commercial at, `@`. On an invoice, you'd write `WIDGETS   12 @ 1.50       18.00`.  
> **username_9** (2023-09-22): @user71659 I'd rather understand the @ sign here as literal 'at', like '12 [pieces] at 1.50 [each]', not as a multiplication as in '12 times 1.50', but I'm not a native speaker, so I might be wrong.  
> **username_10** (2023-09-22): @elzell Isn't "12 pieces at 1.50 each" a multiplication, ultimately?  
> **username_10** (2023-09-22): @el.pescado Early computers didn't have custom-made keyboards, but they typically reused electric typewriter and teleprinter hardware for input. https://en.wikipedia.org/wiki/Computer_keyboard#History  And those were not made for number crunching.  
> **username_11** (2023-09-23): @FedericoPoloni I'd argue that the word "at" in that context has a meaning which is in one way more general than multiplication, and in another way more specific. It does imply multiplication in this context, but more generally it implies a unit conversion, and more specifically here it is multiplication by a conversion rate (in this case, a rate of "dollars per widget"). Compare with "2 hours at 50km/h", where the second number is a rate for converting time into distance, but you can also say "100km at 50km/h" and then the word "at" implies division, not multiplication.  
> **username_12** (2023-09-26): @FedericoPoloni: I think "@" might be viewed as part of a three-operand "ratio" operator, which multiplies one thing by a second and divides by a third.  On many architectures, this could be a useful construct, and one for which IIRC Niklaus Wirth (but maybe it was Donald Knuth, or maybe both) advocated, since multiplication can often produce a double-width product, and division can often accept a double-width dividend, and the same register may be used for both.  
> **username_11** (2023-09-26): Amazing quote from the linked paper by Backus and Henrick, forecasting much higher-level languages: *"In fact a programmer might not be considered too unreasonable if he were willing only to produce the formulas for the numerical solution of his problem [...] and then demand that the machine produce the results for his problem. No doubt if he were too insistent next week about this sort of thing he would be subject to psychiatric observation. However, next year he might be taken more seriously."*  
---
### Answer by username_11 on 2023-09-21. Score: 44
The other answers have covered the first uses of `*` in programming languages. To these I will add that the asterisk has been used as a symbol for multiplication in mathematics since as far back as 1668, by Swiss author Johan Heinrich Rahn and others ([source](https://www.jstor.org/stable/2300111)).

The division symbol $\div$ was also introduced at about the same time. Both are out of favour in modern formal mathematical notation, but saw widespread use in the past and are still used informally. So it makes sense that the asterisk would have been considered as an option for the multiplication operator in programming language syntax.
> **Comments:**
> **username_13** (2023-09-21): Great observation; here's the primary source: https://www.google.com/books/edition/Teutsche_Algebra/ZJg_AAAAcAAJ?hl=en&gbpv=1&pg=PA7&printsec=frontcover  
> **username_14** (2023-09-23): Nice one - other answers explain why `×` and `·` are rare in programming languages, but this explains why `*` is the best alternative.  
---
### Answer by username_15 on 2023-09-21. Score: 35
The fundamental reason is because neither true multiplication symbols `×` nor `⋅` were (or are) common on US keyboards. Using symbols that are not available on the keyboard is a far bigger problem than learning a new symbol for multiplication because after the trivial learning bump of associating `*` with multiplication it has no real cost whereas as needing characters off the keyboard or using a compound symbol (e.g. `.x.`) is a permanent slowdown.

The alternatives of `x` and `.` have major problems of their own. Using `x` would have caused parsing problems and stopped `x` being used as a variable. Using `.` would have been even worse as it clashes with the use of a full stop as the decimal separator that is normal among English speakers. There could, presumably, have been other symbols used but `*` is the one closest in appearance to the `×` and most other symbols already had established meanings that would have prevented their use.

FORTRAN seems to have been the first language to adopt the convention in [1956](https://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf) with the manual simply stating "The symbol \* denotes multiplication" without explanation. From there it seems to have become ubiquitous but given how other languages have changed almost every convention in one way or another, the origin in FORTRAN does not seem to me to be a particularly important justification for the usage and I think the reasons given at the start of this answer are more important than historical accident - ultimately `*` is simply the only good solution for English speakers, perhaps had German speakers driven the development of programming languages we'd all use `,` as the decimal separator and `.` as multiplication.
> **Comments:**
> **username_16** (2023-09-21): And, speaking of German speakers, there would be a need for a separator of parameters in a function, and `*` would have been the only unused common symbol... Imagine calling `f(2* 3,4* 5.6);` instead of our `f(2, 3.4, 5*6);`  
> **username_17** (2023-09-21): If you use a Spanish keyboard then the middle dot character `·` is very common ;-)  
> **username_15** (2023-09-21): @AaronF: Indeed, many of the features of early programming languages (and inherited from them over time) are tied to their US-centric origins.  
> **username_18** (2023-09-21): @vsz Obviously this purely hypothetical, but the normal substitute for a comma separator is the semicolon in German (this is how German Excel formats CSV files btw). So it would more like be something like this `f(2; 3,4; 5.6)\ ` if Germans had designed C.  
> **username_19** (2023-09-21): In most languages, allowing x to be both a variable name and an operator would not be impossible or impractical (except in FORTRAN).  It would complicate lexing & parsing, to be sure.  But since x as an operator is a binary operator, and x as a variable does not appear in the same positions as binary operators, I think it could be done.  But it'd uglify parsing for not much gain (in my opinion).  
> **username_20** (2023-09-22): @WayneConrad, what makes you think that allowing `x` to be both a variable name and an operator would have been any more or less difficult in Fortran than in other languages?  From a language syntax perspective, I see pretty much the same ambiguities arising from across the spectrum of languages that both (i) use infix notation for arithmetic operations and (ii) allow the `x` character to appear in identifiers.  
> **username_19** (2023-09-22): @JohnBollinger That's a mistake I made in that comment.  I thought that spaces were allowed in a variable name in e.g. FORTRAN IV, but they are not.  If spaces were allowed, then "X X X" could be "X times X", or it could be a variable named "XXX".  That's what I thought.  However, since spaces are not allowed, I was wrong about that.  FORTRAN would pose no special challenges for allowing "X" to denote multiplication.  Thank you for challenging my incorrect comment.  
> **username_12** (2023-09-22): @WayneConrad: In FORTRAN, spaces are ignored in almost all contexts.  A statement like `DO 10 I=1.5` would create a variable named `DO10I` and set it to 1.5, while a statement `DO10I=1,5` would indicate the start of a loop that ended on line 10 and would iterate `I` from 1 to 5.  
> **username_19** (2023-09-22): @supercat In which case I was right to begin with, and my retraction was wrong.  
> **username_12** (2023-09-22): @JohnBollinger: If X were a multiplication operator only when the left operand was a numeric literal, then it would be possible to interpret `THEVAR=3XFOO` as storing the product of 3 and `FOO` into `THEVAR`, but FORTRAN would have no way of determining whether `MYVAR=IT X 123` was storing the product of `IT` and the number 123, or a variable called `ITX123`.  
> **username_12** (2023-09-22): @WayneConrad: Precisely.  FORTRAN could probably without difficulty have used `.X.` in a manner analogous to its relational operators, or said that two expressions enclosed in parentheses which appear consecutive on either side of `X`, or without `X` for that matter, will be multiplied, but a letter `X` couldn't work in most contexts without punctuation.  
> **username_20** (2023-09-22): You seem to have taken my point backwards, @WayneConrad.  It is not that using `X` for multiplication could be OK in Fortran.  It's that it would be about as bad in any other language meeting the criteria I gave. Whereas fixed-form Fortran is unusual in making spaces insignificant most everywhere, most other languages make them *optional*.  So in C, for example, `thevar = foo * 3` means exactly the same thing as `thevar=foo*3`, but you could not achieve the same with `x` as the multiplication operator.  
> **username_20** (2023-09-22): Yes, @supercat, `THEVAR=3XFOO` could conceivably be parsed as a multiplication in Fortran, but that's moot because you cannot ignore the case where the left operand is expressed as an identifier.  In any case, my point is primarily that other common languages would have approximately the same problem with `x` as a multiplication operator as Fortran would have, not so much about Fortran in particular.  
> **username_12** (2023-09-22): @JohnBollinger: Quite a few languages would require a space between a keyword and an identifier that was next to it, so saying that `foo = bar x 3;` would apply the `x` operator would be no more problematic than saying (as Turbo Pascal does) than `foo := bar shr 3;` would apply the shifty-right operator.  What's funny is that pre-C89 C didn't ever require spaces before `+` or a `-` operator, but C89 added a requirement for a space after a hex constant that is congruent (mod 16) to 14.  
---
### Answer by username_21 on 2023-09-20. Score: 3
FORTRAN I
Based on some quick research, it appears that FORTRAN I was the first language to use * for multiplication. You can see a sample of FORTRAN I code here, which does appear to use *[1]
READ 1, N, (A(1), 1 * l,N)
...
DO 20, I * 2,N

(copied out the best I can read).
There are also several examples around of FORTRAN II using * for multiplication[2], so it's really more up to whether FORTRAN I or II did it first.
You'd have to go back and either read the original FORTRAN tech reports or similar to figure out why they used *, but I'm assuming it's exactly because it looks similar to an interpunct.
As an anecdote, this would rather funnily indicate that using * for multiplication is quite literally as old as programming languages.
[1] http://www.paulgraham.com/history.html
[2] https://github.com/scivision/fortran-II-examples/blob/main/funcs58.f
eg:
      term = -prevxp / presxp * y * term
> **Comments:**
> **username_22** (2023-09-22): **Your [1] is not an asterisk and not multiplication.** Expand the gif (e.g. to fullscreen) and you'll see it's a closely-spaced equal sign `=` meaning assignment just like the one in `BIGA = A(1)`. And there's no lower-case ell `l` on machines of that vintage; the read list is `(A(I), I=1,N)`. (`I` is a variable, `1` is not.) A DO-statement _or_ I/O-implied-DO with no assignment wouldn't make any sense.  
---
### Answer by username_23 on 2023-10-06. Score: 1
As discussed on [RetroComputing](https://retrocomputing.stackexchange.com/questions/16051/why-do-keyboards-have-an-asterisk-key), the asterisk character existed on IBM punch cards before electronic computers:

"asterisk was added to IBM punch card codes 'somewhere around 1932' and was used for cheque protection. This was a 39-character set: alphanumerics, minus sign, ampersand, asterisk."

So, as discussed in other answers, it was appropriate, there was little other choice, and [*it existed*](https://textfiles.meulie.net/bitsaved/Books/Mackenzie_CodedCharSets.pdf).
---
