Skip to main content
added 17 characters in body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.

Note that this is inclusive range. For the cost of a byte (3 bytes), we can make this exclusive:

’rP

Try it online. Note that the arguments must be given in the order b a for this version.

##Explanation

###Inclusive

a rP b
  r   dyadic atom, creates inclusive range between a and b
   P  computes product of the list

###Exclusive

b ’rP a
  ’   decrement b (by default, monadic atoms in dyadic chains operate on the left argument)
   r  range
    P product 

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.

Note that this is inclusive range. For the cost of a byte (3 bytes), we can make this exclusive:

’rP

Try it online. Note that the arguments must be given in the order b a.

##Explanation

###Inclusive

a rP b
  r   dyadic atom, creates inclusive range between a and b
   P  computes product of the list

###Exclusive

b ’rP a
  ’   decrement b (by default, monadic atoms in dyadic chains operate on the left argument)
   r  range
    P product 

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.

Note that this is inclusive range. For the cost of a byte (3 bytes), we can make this exclusive:

’rP

Try it online. Note that the arguments must be given in the order b a for this version.

##Explanation

###Inclusive

a rP b
  r   dyadic atom, creates inclusive range between a and b
   P  computes product of the list

###Exclusive

b ’rP a
  ’   decrement b (by default, monadic atoms in dyadic chains operate on the left argument)
   r  range
    P product 
added 249 characters in body
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.

Note that this is inclusive range. For the cost of a byte (3 bytes), we can make this exclusive:

’rP

Try it online. Note that the arguments must be given in the order b a.

##Explanation

###Inclusive

a rP b
  r   dyadic atom, creates inclusive range between a and b
   P  computes product of the list

###Exclusive

b ’rP a
  ’   decrement b (by default, monadic atoms in dyadic chains operate on the left argument)
   r  range
    P product 

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.

Note that this is inclusive range. For the cost of a byte (3 bytes), we can make this exclusive:

’rP

Try it online. Note that the arguments must be given in the order b a.

##Explanation

###Inclusive

a rP b
  r   dyadic atom, creates inclusive range between a and b
   P  computes product of the list

###Exclusive

b ’rP a
  ’   decrement b (by default, monadic atoms in dyadic chains operate on the left argument)
   r  range
    P product 
Source Link
a spaghetto
  • 11.3k
  • 3
  • 46
  • 82

#Jelly, 2 bytes

rP

Takes two numbers as command line arguments. Try it online.