difference between * and &; for example 101 * 101 and 101 & 101 ?

Ryan$

Junior Member
Joined
Jan 25, 2019
Messages
184
Hi guys, maybe it's not related that much to math but yeah it's related a lil.
what's the difference between * and & ? for example
101 * 101 , 101 & 101 ? thanks alot,
 

Harry_the_cat

Senior Member
Joined
Mar 16, 2016
Messages
1,238
The * symbol is often used for multiplication simply because the x symbol (for multiplication) could be mistaken for the variable x.
The & symbol means "and".
 

Ryan$

Junior Member
Joined
Jan 25, 2019
Messages
184
so "and" isn't multiplication ? if so, then it's something new for me... I always say and and multiplication is the same term...
 

Harry_the_cat

Senior Member
Joined
Mar 16, 2016
Messages
1,238
In basic probability we sometimes use the word "and" to indicate multiplication and "or" to indicate addition, but a lot of care must be taken when doing so.
 

Ryan$

Junior Member
Joined
Jan 25, 2019
Messages
184
So generally multiply isn't and .. I must differentiante between.. Right?
 

Harry_the_cat

Senior Member
Joined
Mar 16, 2016
Messages
1,238
What's 3 oranges and 4 oranges?
 

Ryan$

Junior Member
Joined
Jan 25, 2019
Messages
184
Oranges :)
 

Harry_the_cat

Senior Member
Joined
Mar 16, 2016
Messages
1,238
7 or 12 ??
 

Ryan$

Junior Member
Joined
Jan 25, 2019
Messages
184
7
 

Harry_the_cat

Senior Member
Joined
Mar 16, 2016
Messages
1,238
So "and" doesn't mean multiply!
 

ksdhart2

Senior Member
Joined
Mar 25, 2016
Messages
1,069
The difference between the symbols "*" and "&" depends entirely on what context we're operating in. In our usual mathematics, the asterisk () means multiplication. But in Boolean Algebra, an asterisk is sometimes used as a substitute for the logical and operator (\(\displaystyle \wedge\)), such that \(\displaystyle \text{TRUE} * \text{FALSE} = \text{TRUE} \wedge \text{FALSE} = \text{FALSE}\).

In some programming languages, such as Javascript, the ampersand (&) operator is defined as the "bitwise and" operator which "returns a 1 in each bit position for which the corresponding bits of both operands are 1s." For example, \(\displaystyle 5 \: \& \: 13 = 5\) because 5 is 0101 in binary and 13 is 1101 in binary and \(\displaystyle 0101 \: \& \: 1101 = 0101\).

In other contexts, each of these symbols may have other, alternate meanings. Some meanings are more "standard" than others, but it all depends on what the author wants them to mean.
 
Last edited:

Jomo

Elite Member
Joined
Dec 30, 2014
Messages
3,529
Along the line of what Harry the Cat asked what is 4 and 5? AFTER you get your answer think if YOU added or multiplied.
 
Top