User Tools


====== Function / ====== ====Syntax==== * **/** //number// → //reciprocal// * **/** //numerator ''&rest'' denominators''+''// → //quotient// ====Arguments and Values==== * //number//, //denominator// - a non-zero //[[CL:Glossary:number]]//. * //numerator//, //quotient//, //reciprocal// - a //[[CL:Glossary:number]]//. ====Description==== The //[[CL:Glossary:function]]// **/** performs division or reciprocation. If no //denominators// are supplied, the function **/** returns the reciprocal of //number//. If at least one //denominator// is supplied, the function **/** divides the //numerator// by all of the //denominators// and returns the resulting //quotient//. If each //[[CL:Glossary:argument]]// is either an //[[CL:Glossary:integer]]// or a //[[CL:Glossary:ratio]]//, and the result is not an //[[CL:Glossary:integer]]//, then it is a //[[CL:Glossary:ratio]]//. The //[[CL:Glossary:function]]// **/** performs necessary type conversions. If any //argument// is a //[[CL:Glossary:float]]// then the rules of floating-point contagion apply; see section {\secref\FloatingPointComputations}. ====Examples==== <blockquote> (/ 12 4) <r>3 </r> (/ 13 4) <r>13/4 </r> (/ -8) <r>-1/8 </r> (/ 3 4 5) <r>3/20 </r> (/ 0.5) <r>2.0 </r> (/ 20 5) <r>4 </r> (/ 5 20) <r>1/4 </r> (/ 60 -2 3 5.0) <r>-2.0 </r> (/ 2 #c(2 2)) <r>#C(1/2 -1/2)</r> </blockquote> ====Affected By==== None. ====Exceptional Situations==== The consequences are unspecified if any //[[CL:Glossary:argument]]// other than the first is zero. If there is only one //[[CL:Glossary:argument]]//, the consequences are unspecified if it is zero. Might signal **[[CL:Types:type-error]]** if some //[[CL:Glossary:argument]]// is not a //[[CL:Glossary:number]]//. Might signal **[[CL:Types:division-by-zero]]** if division by zero is attempted. Might signal **[[CL:Types:arithmetic-error]]**. ====See Also==== * **[[CL:Functions:floor|Function FLOOR]]** * **[[CL:Functions:ceiling|Function CEILING]]** * **[[CL:Functions:truncate|Function TRUNCATE]]** * **[[CL:Functions:round|Function ROUND]]** ====Notes==== None.