\doxysection{workspace/post-\/scarcity/src/arith/ratio.h File Reference}
\hypertarget{ratio_8h}{}\label{ratio_8h}\index{workspace/post-\/scarcity/src/arith/ratio.h@{workspace/post-\/scarcity/src/arith/ratio.h}}
This graph shows which files directly or indirectly include this file\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{ratio_8h__dep__incl}
\end{center}
\end{figure}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_a970e02ec84fab27b4d33150eb50bdc8e}{add\+\_\+integer\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} intarg, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} ratarg)
\begin{DoxyCompactList}\small\item\em return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the sum of the intger indicated by {\ttfamily intarg} and the ratio indicated by {\ttfamily ratarg}. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_a5bb772b5fbc470c30659b61ac2f0ebf5}{add\+\_\+ratio\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg1, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg2)
\begin{DoxyCompactList}\small\item\em return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the sum of the ratios indicated by {\ttfamily arg1} and {\ttfamily arg2}. \end{DoxyCompactList}\item 
long double \mbox{\hyperlink{ratio_8h_a0fe47053f1b1b94101748d354c1a76be}{c\+\_\+ratio\+\_\+to\+\_\+ld}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} rat)
\begin{DoxyCompactList}\small\item\em convert a ratio to an equivalent long double. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_a6edf067028767b399bdc4181b0b808d4}{divide\+\_\+ratio\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg1, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg2)
\begin{DoxyCompactList}\small\item\em return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} to a ratio which represents the value of the ratio indicated by {\ttfamily arg1} divided by the ratio indicated by {\ttfamily arg2}. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{ratio_8h_a63c0888d86fd97b087a259dd507b618c}{equal\+\_\+ratio\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} a, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} b)
\begin{DoxyCompactList}\small\item\em True if a and be are identical rationals, else false. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_ad2832e83566ce131e54397c3e165899c}{make\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} dividend, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} divisor, bool simplify)
\begin{DoxyCompactList}\small\item\em Construct a ratio frame from this {\ttfamily dividend} and {\ttfamily divisor}, expected to be integers, in the context of the \doxylink{consspaceobject_8h_structstack__frame}{stack\+\_\+frame} indicated by this {\ttfamily frame\+\_\+pointer}. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_a921ee5ce45e59014688c02bca2397b98}{multiply\+\_\+integer\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} intarg, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} ratarg)
\begin{DoxyCompactList}\small\item\em return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the product of the intger indicated by {\ttfamily intarg} and the ratio indicated by {\ttfamily ratarg}. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_a60ef7247767c19d1ec458406366561fb}{multiply\+\_\+ratio\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg1, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg2)
\begin{DoxyCompactList}\small\item\em return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the product of the ratios indicated by {\ttfamily arg1} and {\ttfamily arg2}. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_a0a0daf24710922f57cc34d20e8bd9dca}{simplify\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg)
\begin{DoxyCompactList}\small\item\em \doxylink{ratio_8h}{ratio.\+h} \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} \mbox{\hyperlink{ratio_8h_ac58f726144640d5bce62d7e5e3eaae45}{subtract\+\_\+ratio\+\_\+ratio}} (struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg1, struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} arg2)
\begin{DoxyCompactList}\small\item\em return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the difference of the ratios indicated by {\ttfamily arg1} and {\ttfamily arg2}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\Hypertarget{ratio_8h_a970e02ec84fab27b4d33150eb50bdc8e}\label{ratio_8h_a970e02ec84fab27b4d33150eb50bdc8e} 
\index{ratio.h@{ratio.h}!add\_integer\_ratio@{add\_integer\_ratio}}
\index{add\_integer\_ratio@{add\_integer\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{add\_integer\_ratio()}{add\_integer\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} add\+\_\+integer\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{intarg,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{ratarg }\end{DoxyParamCaption})}



return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the sum of the intger indicated by {\ttfamily intarg} and the ratio indicated by {\ttfamily ratarg}. 


\begin{DoxyExceptions}{Exceptions}
{\em if} & either \`{}intarg\`{} or \`{}ratarg\`{} is not of the expected type. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00137}{137}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{integer_8c_source_l00129}{acquire\+\_\+integer()}}, \mbox{\hyperlink{ratio_8c_source_l00093}{add\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00454}{c\+\_\+string\+\_\+to\+\_\+lisp\+\_\+string()}}, \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00080}{dec\+\_\+ref()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00353}{integerp}}, \mbox{\hyperlink{consspaceobject_8c_source_l00177}{make\+\_\+cons()}}, \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00277}{NIL}}, \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}, \mbox{\hyperlink{integer_8c_source_l00163}{release\+\_\+integer()}}, and \mbox{\hyperlink{lispops_8c_source_l01208}{throw\+\_\+exception()}}.



Referenced by \mbox{\hyperlink{peano_8c_source_l00217}{add\+\_\+2()}}.

\Hypertarget{ratio_8h_a5bb772b5fbc470c30659b61ac2f0ebf5}\label{ratio_8h_a5bb772b5fbc470c30659b61ac2f0ebf5} 
\index{ratio.h@{ratio.h}!add\_ratio\_ratio@{add\_ratio\_ratio}}
\index{add\_ratio\_ratio@{add\_ratio\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{add\_ratio\_ratio()}{add\_ratio\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} add\+\_\+ratio\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg1,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg2 }\end{DoxyParamCaption})}



return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the sum of the ratios indicated by {\ttfamily arg1} and {\ttfamily arg2}. 


\begin{DoxyExceptions}{Exceptions}
{\em will} & return an exception if either \`{}arg1\`{} or \`{}arg2\`{} is not a rational number. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00093}{93}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{integer_8c_source_l00224}{add\+\_\+integers()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00454}{c\+\_\+string\+\_\+to\+\_\+lisp\+\_\+string()}}, \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00177}{make\+\_\+cons()}}, \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}, \mbox{\hyperlink{integer_8c_source_l00343}{multiply\+\_\+integers()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00277}{NIL}}, \mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{cons\+\_\+space\+\_\+object\+::payload}}, \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}, \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}, and \mbox{\hyperlink{lispops_8c_source_l01208}{throw\+\_\+exception()}}.



Referenced by \mbox{\hyperlink{peano_8c_source_l00217}{add\+\_\+2()}}, \mbox{\hyperlink{ratio_8c_source_l00137}{add\+\_\+integer\+\_\+ratio()}}, and \mbox{\hyperlink{ratio_8c_source_l00290}{subtract\+\_\+ratio\+\_\+ratio()}}.

\Hypertarget{ratio_8h_a0fe47053f1b1b94101748d354c1a76be}\label{ratio_8h_a0fe47053f1b1b94101748d354c1a76be} 
\index{ratio.h@{ratio.h}!c\_ratio\_to\_ld@{c\_ratio\_to\_ld}}
\index{c\_ratio\_to\_ld@{c\_ratio\_to\_ld}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{c\_ratio\_to\_ld()}{c\_ratio\_to\_ld()}}
{\footnotesize\ttfamily long double c\+\_\+ratio\+\_\+to\+\_\+ld (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{rat }\end{DoxyParamCaption})}



convert a ratio to an equivalent long double. 


\begin{DoxyParams}{Parameters}
{\em rat} & a pointer to a ratio. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
long double 
\end{DoxyReturn}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00379}{379}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{debug_8c_source_l00101}{debug\+\_\+printf()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00303}{nilp}}, \mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{cons\+\_\+space\+\_\+object\+::payload}}, \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}, and \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}.



Referenced by \mbox{\hyperlink{equal_8c_source_l00155}{equal\+\_\+real\+\_\+number()}}, and \mbox{\hyperlink{peano_8c_source_l00755}{lisp\+\_\+ratio\+\_\+to\+\_\+real()}}.

\Hypertarget{ratio_8h_a6edf067028767b399bdc4181b0b808d4}\label{ratio_8h_a6edf067028767b399bdc4181b0b808d4} 
\index{ratio.h@{ratio.h}!divide\_ratio\_ratio@{divide\_ratio\_ratio}}
\index{divide\_ratio\_ratio@{divide\_ratio\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{divide\_ratio\_ratio()}{divide\_ratio\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} divide\+\_\+ratio\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg1,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg2 }\end{DoxyParamCaption})}



return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} to a ratio which represents the value of the ratio indicated by {\ttfamily arg1} divided by the ratio indicated by {\ttfamily arg2}. 


\begin{DoxyExceptions}{Exceptions}
{\em will} & return an exception if either \`{}arg1\`{} or \`{}arg2\`{} is not a rational number. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00176}{176}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00080}{dec\+\_\+ref()}}, \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}, \mbox{\hyperlink{ratio_8c_source_l00203}{multiply\+\_\+ratio\+\_\+ratio()}}, and \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}.



Referenced by \mbox{\hyperlink{peano_8c_source_l00655}{lisp\+\_\+divide()}}.

\Hypertarget{ratio_8h_a63c0888d86fd97b087a259dd507b618c}\label{ratio_8h_a63c0888d86fd97b087a259dd507b618c} 
\index{ratio.h@{ratio.h}!equal\_ratio\_ratio@{equal\_ratio\_ratio}}
\index{equal\_ratio\_ratio@{equal\_ratio\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{equal\_ratio\_ratio()}{equal\_ratio\_ratio()}}
{\footnotesize\ttfamily bool equal\+\_\+ratio\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{a,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{b }\end{DoxyParamCaption})}



True if a and be are identical rationals, else false. 

TODO\+: we need ways of checking whether rationals are equal to floats and to integers. 

Definition at line \mbox{\hyperlink{ratio_8c_source_l00357}{357}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{integer_8c_source_l00511}{equal\+\_\+integer\+\_\+integer()}}, \mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{cons\+\_\+space\+\_\+object\+::payload}}, \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}, and \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}.



Referenced by \mbox{\hyperlink{equal_8c_source_l00247}{equal()}}, and \mbox{\hyperlink{equal_8c_source_l00195}{equal\+\_\+number\+\_\+number()}}.

\Hypertarget{ratio_8h_ad2832e83566ce131e54397c3e165899c}\label{ratio_8h_ad2832e83566ce131e54397c3e165899c} 
\index{ratio.h@{ratio.h}!make\_ratio@{make\_ratio}}
\index{make\_ratio@{make\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{make\_ratio()}{make\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} make\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{dividend,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{divisor,  }\item[{bool}]{simplify }\end{DoxyParamCaption})}



Construct a ratio frame from this {\ttfamily dividend} and {\ttfamily divisor}, expected to be integers, in the context of the \doxylink{consspaceobject_8h_structstack__frame}{stack\+\_\+frame} indicated by this {\ttfamily frame\+\_\+pointer}. 


\begin{DoxyExceptions}{Exceptions}
{\em if} & either \`{}dividend\`{} or \`{}divisor\`{} is not an integer. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00312}{312}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{conspage_8c_source_l00222}{allocate\+\_\+cell()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00454}{c\+\_\+string\+\_\+to\+\_\+lisp\+\_\+string()}}, \mbox{\hyperlink{debug_8h_source_l00021}{DEBUG\+\_\+\+ALLOC}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{debug_8c_source_l00101}{debug\+\_\+printf()}}, \mbox{\hyperlink{debug_8c_source_l00085}{debug\+\_\+println()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00080}{dec\+\_\+ref()}}, \mbox{\hyperlink{equal_8c_source_l00024}{eq()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00062}{inc\+\_\+ref()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00353}{integerp}}, \mbox{\hyperlink{consspaceobject_8h_source_l00277}{NIL}}, \mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{cons\+\_\+space\+\_\+object\+::payload}}, \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}, \mbox{\hyperlink{consspaceobject_8h_source_l00179}{RATIOTV}}, \mbox{\hyperlink{ratio_8c_source_l00048}{simplify\+\_\+ratio()}}, and \mbox{\hyperlink{lispops_8c_source_l01208}{throw\+\_\+exception()}}.



Referenced by \mbox{\hyperlink{peano_8c_source_l00089}{absolute()}}, \mbox{\hyperlink{ratio_8c_source_l00137}{add\+\_\+integer\+\_\+ratio()}}, \mbox{\hyperlink{ratio_8c_source_l00093}{add\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{ratio_8c_source_l00176}{divide\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{peano_8c_source_l00655}{lisp\+\_\+divide()}}, \mbox{\hyperlink{ratio_8c_source_l00254}{multiply\+\_\+integer\+\_\+ratio()}}, \mbox{\hyperlink{ratio_8c_source_l00203}{multiply\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{peano_8c_source_l00489}{negative()}}, \mbox{\hyperlink{read_8c_source_l00288}{read\+\_\+number()}}, \mbox{\hyperlink{ratio_8c_source_l00048}{simplify\+\_\+ratio()}}, and \mbox{\hyperlink{peano_8c_source_l00544}{subtract\+\_\+2()}}.

\Hypertarget{ratio_8h_a921ee5ce45e59014688c02bca2397b98}\label{ratio_8h_a921ee5ce45e59014688c02bca2397b98} 
\index{ratio.h@{ratio.h}!multiply\_integer\_ratio@{multiply\_integer\_ratio}}
\index{multiply\_integer\_ratio@{multiply\_integer\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{multiply\_integer\_ratio()}{multiply\_integer\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} multiply\+\_\+integer\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{intarg,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{ratarg }\end{DoxyParamCaption})}



return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the product of the intger indicated by {\ttfamily intarg} and the ratio indicated by {\ttfamily ratarg}. 


\begin{DoxyExceptions}{Exceptions}
{\em if} & either \`{}intarg\`{} or \`{}ratarg\`{} is not of the expected type. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00254}{254}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{integer_8c_source_l00129}{acquire\+\_\+integer()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00454}{c\+\_\+string\+\_\+to\+\_\+lisp\+\_\+string()}}, \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00353}{integerp}}, \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}, \mbox{\hyperlink{ratio_8c_source_l00203}{multiply\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00277}{NIL}}, \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}, \mbox{\hyperlink{integer_8c_source_l00163}{release\+\_\+integer()}}, and \mbox{\hyperlink{lispops_8c_source_l01208}{throw\+\_\+exception()}}.



Referenced by \mbox{\hyperlink{peano_8c_source_l00349}{multiply\+\_\+2()}}.

\Hypertarget{ratio_8h_a60ef7247767c19d1ec458406366561fb}\label{ratio_8h_a60ef7247767c19d1ec458406366561fb} 
\index{ratio.h@{ratio.h}!multiply\_ratio\_ratio@{multiply\_ratio\_ratio}}
\index{multiply\_ratio\_ratio@{multiply\_ratio\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{multiply\_ratio\_ratio()}{multiply\_ratio\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} multiply\+\_\+ratio\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg1,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg2 }\end{DoxyParamCaption})}



return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the product of the ratios indicated by {\ttfamily arg1} and {\ttfamily arg2}. 


\begin{DoxyExceptions}{Exceptions}
{\em will} & return an exception if either \`{}arg1\`{} or \`{}arg2\`{} is not a rational number. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00203}{203}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{integer_8c_source_l00129}{acquire\+\_\+integer()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00454}{c\+\_\+string\+\_\+to\+\_\+lisp\+\_\+string()}}, \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00277}{NIL}}, \mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{cons\+\_\+space\+\_\+object\+::payload}}, \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}, \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}, \mbox{\hyperlink{integer_8c_source_l00163}{release\+\_\+integer()}}, and \mbox{\hyperlink{lispops_8c_source_l01208}{throw\+\_\+exception()}}.



Referenced by \mbox{\hyperlink{ratio_8c_source_l00176}{divide\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{peano_8c_source_l00349}{multiply\+\_\+2()}}, and \mbox{\hyperlink{ratio_8c_source_l00254}{multiply\+\_\+integer\+\_\+ratio()}}.

\Hypertarget{ratio_8h_a0a0daf24710922f57cc34d20e8bd9dca}\label{ratio_8h_a0a0daf24710922f57cc34d20e8bd9dca} 
\index{ratio.h@{ratio.h}!simplify\_ratio@{simplify\_ratio}}
\index{simplify\_ratio@{simplify\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{simplify\_ratio()}{simplify\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} simplify\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg }\end{DoxyParamCaption})}



\doxylink{ratio_8h}{ratio.\+h} 

functions for rational number cells.

(c) 2017 Simon Brooke \href{mailto:simon@journeyman.cc}{\texttt{ simon@journeyman.\+cc}} Licensed under GPL version 2.\+0, or, at your option, any later version. 

Definition at line \mbox{\hyperlink{ratio_8c_source_l00048}{48}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{integer_8c_source_l00129}{acquire\+\_\+integer()}}, \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00101}{debug\+\_\+printf()}}, \mbox{\hyperlink{ratio_8c_source_l00030}{greatest\+\_\+common\+\_\+divisor()}}, \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}, \mbox{\hyperlink{consspaceobject_8h_source_l00277}{NIL}}, \mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{cons\+\_\+space\+\_\+object\+::payload}}, \mbox{\hyperlink{consspaceobject_8h_source_l00297}{pointer2cell}}, and \mbox{\hyperlink{consspaceobject_8h_source_l00358}{ratiop}}.



Referenced by \mbox{\hyperlink{ratio_8c_source_l00312}{make\+\_\+ratio()}}.

\Hypertarget{ratio_8h_ac58f726144640d5bce62d7e5e3eaae45}\label{ratio_8h_ac58f726144640d5bce62d7e5e3eaae45} 
\index{ratio.h@{ratio.h}!subtract\_ratio\_ratio@{subtract\_ratio\_ratio}}
\index{subtract\_ratio\_ratio@{subtract\_ratio\_ratio}!ratio.h@{ratio.h}}
\doxysubsubsection{\texorpdfstring{subtract\_ratio\_ratio()}{subtract\_ratio\_ratio()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}} subtract\+\_\+ratio\+\_\+ratio (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg1,  }\item[{struct \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer}}}]{arg2 }\end{DoxyParamCaption})}



return a \doxylink{consspaceobject_8h_structcons__pointer}{cons\+\_\+pointer} indicating a number which is the difference of the ratios indicated by {\ttfamily arg1} and {\ttfamily arg2}. 


\begin{DoxyExceptions}{Exceptions}
{\em will} & return an exception if either \`{}arg1\`{} or \`{}arg2\`{} is not a rational number. \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{ratio_8c_source_l00290}{290}} of file \mbox{\hyperlink{ratio_8c_source}{ratio.\+c}}.



References \mbox{\hyperlink{ratio_8c_source_l00093}{add\+\_\+ratio\+\_\+ratio()}}, \mbox{\hyperlink{debug_8h_source_l00028}{DEBUG\+\_\+\+ARITH}}, \mbox{\hyperlink{debug_8c_source_l00041}{debug\+\_\+print()}}, \mbox{\hyperlink{debug_8c_source_l00119}{debug\+\_\+print\+\_\+object()}}, \mbox{\hyperlink{consspaceobject_8c_source_l00080}{dec\+\_\+ref()}}, and \mbox{\hyperlink{peano_8c_source_l00489}{negative()}}.



Referenced by \mbox{\hyperlink{peano_8c_source_l00544}{subtract\+\_\+2()}}.

