2008-04-26 00:17:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								USING:  help.markup  help.syntax  kernel  math  math.order 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:21:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								sequences quotations math.functions.private math.constants ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  math.functions 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "integer-functions"  "Integer functions" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    align
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    gcd
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    log2
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    next-power-of-2
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2008-04-17 13:22:24 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Modular exponentiation:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections ^mod mod-inv }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Tests:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    power-of-2?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    even?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    odd?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    divisor?
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "arithmetic-functions"  "Arithmetic functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Computing additive and multiplicative inverses:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections neg  recip  }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Complex conjugation:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections conjugate }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Tests:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections zero?  between? }
							 
						 
					
						
							
								
									
										
										
										
											2009-08-14 15:27:23 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Control flow:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if-zero
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    when-zero
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    unless-zero
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Sign:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections sgn  }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Rounding:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ceiling
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    floor
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    truncate
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    round
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2008-04-17 13:22:24 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Inexact comparison:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections ~ }
							 
						 
					
						
							
								
									
										
										
										
											2009-09-12 17:33:42 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Numbers implement the "  { $link "math.order"  } ", therefore operations such as "  { $link min } " and "  { $link max } " can be used with numbers."  ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "power-functions"  "Powers and logarithms" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Squares:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections sq  sqrt }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Exponential and natural logarithm:" 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:59:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections e^ cis log }
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 16:42:46 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Other logarithms:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections log1+ log10 }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Raising a number to a power:" 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:21:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections ^ e^ 10^ }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Logistics functions:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsections sigmoid }
							 
						 
					
						
							
								
									
										
										
										
											2009-10-30 07:37:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"Finding the root of a number:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsections nth-root }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Converting between rectangular and polar form:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    abs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    absq
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    arg
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    >polar
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    polar>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "trig-hyp-functions"  "Trigonometric and hyperbolic functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Trigonometric functions:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections cos sin tan }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Reciprocals:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections sec cosec cot }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Inverses:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections acos asin atan }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Inverse reciprocals:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections asec acosec acot }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Hyperbolic functions:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections cosh sinh tanh }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Reciprocals:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections sech cosech coth }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Inverses:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections acosh asinh atanh }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Inverse reciprocals:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections asech acosech acoth } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "math-functions"  "Mathematical functions" 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 15:22:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "integer-functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "arithmetic-functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "power-functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "trig-hyp-functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "math-functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  align 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "m"  integer  } { "w"  "a power of 2"  } { "n"  "an integer multiple of "  { $snippet "w"  } } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the least multiple of "  { $snippet "w"  } " greater than "  { $snippet "m"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "This word will give an incorrect result if "  { $snippet "w"  } " is not a power of 2."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:59:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  e^ 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-23 16:22:37 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "e^x"  number  } }
							 
						 
					
						
							
								
									
										
										
										
											2017-03-23 16:24:00 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Exponential function, raises "  { $link e } " to the power of "  { $snippet "x"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-22 12:42:28 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  frexp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  float  } { "exp"  integer  } }
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:59:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Break the number "  { $snippet "x"  } " into a normalized fraction "  { $snippet "y"  } " and an integral power of 2 "  { $snippet "e^"  } "."  $nl "The function returns a number "  { $snippet "y"  } " in the interval [1/2, 1) or 0, and a number "  { $snippet "exp"  } " such that "  { $snippet "x = y*(2**exp)"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-22 12:42:28 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-04-24 14:19:03 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  ldexp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "exp"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Multiply "  { $snippet "x"  } " by "  { $snippet "2^exp"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes { $link ldexp } " is the inverse of "  { $link frexp } "."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  log 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Natural logarithm function. Outputs negative infinity if "  { $snippet "x"  } " is 0."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 21:28:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  log1+ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Takes the natural logarithm of "  { $snippet "1 + x"  } ". Outputs negative infinity if "  { $snippet "1 + x"  } " is zero. This word may be more accurate than "  { $snippet "1 + log"  } " for very small values of "  { $snippet "x"  } "."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-08-11 19:45:01 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  log10 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Logarithm function base 10. Outputs negative infinity if "  { $snippet "x"  } " is 0."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  sqrt 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Square root function."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cosh 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Hyperbolic cosine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  sech 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Hyperbolic secant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  sinh 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Hyperbolic sine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cosech 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Hyperbolic cosecant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  tanh 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Hyperbolic tangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  coth 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Hyperbolic cotangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cos 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Trigonometric cosine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  sec 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Trigonometric secant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  sin 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Trigonometric sine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cosec 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Trigonometric cosecant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  tan 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Trigonometric tangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cot 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Trigonometric cotangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  acosh 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse hyperbolic cosine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  asech 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse hyperbolic secant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  asinh 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse hyperbolic sine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  acosech 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse hyperbolic cosecant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  atanh 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse hyperbolic tangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  acoth 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse hyperbolic cotangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  acos 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse trigonometric cosine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  asec 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse trigonometric secant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  asin 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse trigonometric sine."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  acosec 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse trigonometric cosecant."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  atan 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse trigonometric tangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  acot 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$values-x/y
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Inverse trigonometric cotangent."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  conjugate 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "z"  number  } { "z*"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Computes the complex conjugate by flipping the sign of the imaginary part of "  { $snippet "z"  } "."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  arg 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "z"  number  } { "arg"  "a number in the interval "  { $snippet "(-pi,pi]"  } } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Computes the complex argument."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  >polar 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "z"  number  } { "abs"  "a non-negative real number"  } { "arg"  "a number in the interval "  { $snippet "(-pi,pi]"  } } }
							 
						 
					
						
							
								
									
										
										
										
											2009-02-19 14:35:53 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Converts a complex number into an absolute value and argument (polar form)."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  cis 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "arg"  "a real number"  } { "z"  "a complex number on the unit circle"  } }
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:59:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Computes a point on the unit circle using Euler's formula for "  { $snippet "e^(arg*i)"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:59:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ cis e^ } related-words
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  polar> 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-21 18:40:43 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "abs"  "a non-negative real number"  } { "arg"  real  } { "z"  number  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Converts an absolute value and argument (polar form) to a complex number."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  [-1,1]? 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "?"  boolean  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if "  { $snippet "x"  } " is a real number between -1 and 1, inclusive."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  abs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  "a non-negative real number"  } }
							 
						 
					
						
							
								
									
										
										
										
											2016-07-28 14:02:14 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Computes the absolute value of a number."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $see-also absq } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  absq 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  "a non-negative real number"  } }
							 
						 
					
						
							
								
									
										
										
										
											2016-07-28 14:02:14 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Computes the squared absolute value of a number. For complex numbers this is marginally more efficient than "  { $link abs  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  ^ 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-23 16:22:37 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } { "x^y"  number  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Raises "  { $snippet "x"  } " to the power of "  { $snippet "y"  } ". If "  { $snippet "y"  } " is an integer the answer is computed exactly, otherwise a floating point approximation is used."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $errors "Throws an error if "  { $snippet "x"  } " and "  { $snippet "y"  } " are both integer 0."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-30 07:37:02 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  nth-root 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "n"  integer  } { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Calculates the nth root of a number, such that "  { $snippet "y^n=x"  } "."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-08-11 19:45:01 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  10^ 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-23 16:22:37 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "10^x"  number  } }
							 
						 
					
						
							
								
									
										
										
										
											2011-06-06 19:27:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Raises 10 to the power of "  { $snippet "x"  } ". If "  { $snippet "x"  } " is an integer the answer is computed exactly, otherwise a floating point approximation is used."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-11 19:45:01 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 19:29:19 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  divisor? 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "m"  integer  } { "n"  integer  } { "?"  boolean  } }
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 21:53:18 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Tests if "  { $snippet "n"  } " is a divisor of "  { $snippet "m"  } ". This is the same thing as asking if "  { $snippet "m"  } " is divisible by "  { $snippet "n"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "Returns t for both negative and positive divisors, as well as for trivial and non-trivial divisors."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 19:29:19 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  mod-inv 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  integer  } { "n"  integer  } { "y"  integer  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs an integer "  { $snippet "y"  } " such that "  { $snippet "xy = 1 (mod n)"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $errors "Throws an error if "  { $snippet "n"  } " is not invertible modulo "  { $snippet "n"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
									
										
										
										
											2008-03-11 20:51:58 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "173 1119 mod-inv ."  "815"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math prettyprint ;"  "173 815 * 1119 mod ."  "1"  }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-04-19 11:20:11 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  ^mod 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  real  } { "n"  real  } { "z"  real  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the result of computing "  { $snippet "x^y mod n"  } "."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  ~ 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  real  } { "epsilon"  real  } { "?"  boolean  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Tests if "  { $snippet "x"  } " and "  { $snippet "y"  } " are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of "  { $snippet "epsilon"  } ":" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $list
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        { { $snippet "epsilon"  } " is zero: exact comparison."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        { { $snippet "epsilon"  } " is positive: absolute distance test."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        { { $snippet "epsilon"  } " is negative: relative distance test."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-10-14 20:38:23 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  truncate 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  "a whole real number"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the number that results from subtracting the fractional component of "  { $snippet "x"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The result is not necessarily an integer."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  floor 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  "a whole real number"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the greatest whole number smaller than or equal to "  { $snippet "x"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The result is not necessarily an integer."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  ceiling 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  "a whole real number"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the least whole number greater than or equal to "  { $snippet "x"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The result is not necessarily an integer."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  round 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  "a whole real number"  } }
							 
						 
					
						
							
								
									
										
										
										
											2013-03-26 17:35:38 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Outputs the whole number closest to "  { $snippet "x"  } ", rounding out at half."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The result is not necessarily an integer."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "4.5 round ."  "5.0"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "4.4 round ."  "4.0"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-19 15:19:14 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-24 11:00:07 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  round-to-even 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  "a whole real number"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the whole number closest to "  { $snippet "x"  } ", rounding out at half, breaking ties towards even numbers. This is also known as banker's rounding or unbiased rounding."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The result is not necessarily an integer."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "0.5 round-to-even ."  "0.0"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "1.5 round-to-even ."  "2.0"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  round-to-odd 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  real  } { "y"  "a whole real number"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the whole number closest to "  { $snippet "x"  } ", rounding out at half, breaking ties towards odd numbers."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The result is not necessarily an integer."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "0.5 round-to-odd ."  "1.0"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $example "USING: math.functions prettyprint ;"  "1.5 round-to-odd ."  "1.0"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-04-19 15:19:14 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  roots 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "t"  integer  } { "seq"  sequence  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the "  { $snippet "t"  } " roots of a number "  { $snippet "x"  } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $notes "The results are not necessarily real."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:21:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  sigmoid 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the sigmoid, an S-shaped \"logistic\" function, from 0 to 1, of the number "  { $snippet "x"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-03 17:44:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  signum 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } }
							 
						 
					
						
							
								
									
										
										
										
											2017-06-05 13:13:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Calculates the signum value. For a real number, "  { $snippet "x"  } ", this is its sign (-1, 0, or 1). For a complex number, "  { $snippet "x"  } ", this is the point on the unit circle of the complex plane that is nearest to "  { $snippet "x"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2012-06-01 11:24:35 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  copysign 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "x"  number  } { "y"  number  } { "x'"  number  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Returns "  { $snippet "x"  } " with the sign of "  { $snippet "y"  } ", as a "  { $link float  } "."  } ;