\doxysection{ratio.\+c}
\hypertarget{ratio_8c_source}{}\label{ratio_8c_source}\index{workspace/post-\/scarcity/src/arith/ratio.c@{workspace/post-\/scarcity/src/arith/ratio.c}}
\mbox{\hyperlink{ratio_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00001}00001\ \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00002}00002\ \textcolor{comment}{\ *\ ratio.c}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00003}00003\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00004}00004\ \textcolor{comment}{\ *\ functions\ for\ rational\ number\ cells.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00005}00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00006}00006\ \textcolor{comment}{\ *\ (c)\ 2017\ Simon\ Brooke\ <simon@journeyman.cc>}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00007}00007\ \textcolor{comment}{\ *\ Licensed\ under\ GPL\ version\ 2.0,\ or,\ at\ your\ option,\ any\ later\ version.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00008}00008\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00009}00009\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00010}\mbox{\hyperlink{ratio_8c_a369266c24eacffb87046522897a570d5}{00010}}\ \textcolor{preprocessor}{\#define\ \_GNU\_SOURCE}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00011}00011\ \textcolor{preprocessor}{\#include\ <math.h>}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00012}00012\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00013}00013\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00014}00014\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{integer_8h}{arith/integer.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00015}00015\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{peano_8h}{arith/peano.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00016}00016\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{ratio_8h}{arith/ratio.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00017}00017\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{real_8h}{arith/real.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00018}00018\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{debug_8h}{debug.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00019}00019\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{print_8h}{io/print.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00020}00020\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{conspage_8h}{memory/conspage.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00021}00021\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{consspaceobject_8h}{memory/consspaceobject.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00022}00022\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{stack_8h}{memory/stack.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00023}00023\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{equal_8h}{ops/equal.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00024}00024\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{lispops_8h}{ops/lispops.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00025}00025\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00026}00026\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00027}00027\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00028}00028\ \textcolor{comment}{\ *\ @brief\ return,\ as\ an\ int64\_t,\ the\ greatest\ common\ divisor\ of\ \`{}m`\ and\ \`{}n`,}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00029}00029\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00030}\mbox{\hyperlink{ratio_8c_a2c71c9e0c7c696fe3b504c791274077b}{00030}}\ int64\_t\ \mbox{\hyperlink{ratio_8c_a2c71c9e0c7c696fe3b504c791274077b}{greatest\_common\_divisor}}(\ int64\_t\ m,\ int64\_t\ n\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00031}00031\ \ \ \ \ \textcolor{keywordtype}{int}\ o;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00032}00032\ \ \ \ \ \textcolor{keywordflow}{while}\ (\ m\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00033}00033\ \ \ \ \ \ \ \ \ o\ =\ m;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00034}00034\ \ \ \ \ \ \ \ \ m\ =\ n\ \%\ m;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00035}00035\ \ \ \ \ \ \ \ \ n\ =\ o;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00036}00036\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00037}00037\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00038}00038\ \ \ \ \ \textcolor{keywordflow}{return}\ o;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00039}00039\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00040}00040\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00041}00041\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00042}00042\ \textcolor{comment}{\ *\ @brief\ return,\ as\ an\ int64\_t,\ the\ least\ common\ multiple\ of\ \`{}m`\ and\ \`{}n`,}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00043}00043\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00044}\mbox{\hyperlink{ratio_8c_a8c70c3dcff42e15aa2288d9307b546b8}{00044}}\ int64\_t\ \mbox{\hyperlink{ratio_8c_a8c70c3dcff42e15aa2288d9307b546b8}{least\_common\_multiple}}(\ int64\_t\ m,\ int64\_t\ n\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00045}00045\ \ \ \ \ \textcolor{keywordflow}{return}\ m\ /\ \mbox{\hyperlink{ratio_8c_a2c71c9e0c7c696fe3b504c791274077b}{greatest\_common\_divisor}}(\ m,\ n\ )\ *\ n;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00046}00046\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00047}00047\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00048}\mbox{\hyperlink{ratio_8c_ad84390b94da6403a93728b6b9d5503f0}{00048}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_ad84390b94da6403a93728b6b9d5503f0}{simplify\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ pointer\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00049}00049\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result\ =\ pointer;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00050}00050\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00051}00051\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ pointer\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00052}00052\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ cell\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ pointer\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00053}00053\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ dividend\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00054}00054\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cell.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00055}00055\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ divisor\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00056}00056\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cell.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00057}00057\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00058}00058\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ divisor.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.value\ ==\ 1\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00059}00059\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ pointer\ ).payload.ratio.dividend;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00060}00060\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00061}00061\ \ \ \ \ \ \ \ \ \ \ \ \ int64\_t\ ddrv\ =\ dividend.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.value,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00062}00062\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ drrv\ =\ divisor.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.value,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00063}00063\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gcd\ =\ \mbox{\hyperlink{ratio_8c_a2c71c9e0c7c696fe3b504c791274077b}{greatest\_common\_divisor}}(\ ddrv,\ drrv\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00064}00064\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00065}00065\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ gcd\ >\ 1\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00066}00066\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ drrv\ /\ gcd\ ==\ 1\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00067}00067\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00068}00068\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ (\ int64\_t\ )\ (\ ddrv\ /\ gcd\ ),\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00069}00069\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00070}00070\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}},}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00071}00071\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}simplify\_ratio:\ \%ld/\%ld\ =>\ \%ld/\%ld\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00072}00072\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ddrv,\ drrv,\ ddrv\ /\ gcd,\ drrv\ /\ gcd\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00073}00073\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00074}00074\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ ddrv\ /\ gcd,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00075}00075\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ drrv\ /\ gcd,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ ),\ \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00076}00076\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00077}00077\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00078}00078\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00079}00079\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00080}00080\ \ \ \ \ \textcolor{comment}{//\ TODO:\ else\ throw\ exception?}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00081}00081\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00082}00082\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00083}00083\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00084}00084\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00085}00085\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00086}00086\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00087}00087\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00088}00088\ \textcolor{comment}{\ *\ return\ a\ cons\_pointer\ indicating\ a\ number\ which\ is\ the\ sum\ of}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00089}00089\ \textcolor{comment}{\ *\ the\ ratios\ indicated\ by\ \`{}arg1`\ and\ \`{}arg2`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00090}00090\ \textcolor{comment}{\ *\ @exception\ will\ return\ an\ exception\ if\ either\ \`{}arg1`\ or\ \`{}arg2`\ is\ not\ a}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00091}00091\ \textcolor{comment}{\ *\ rational\ number.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00092}00092\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00093}\mbox{\hyperlink{ratio_8c_a5bb772b5fbc470c30659b61ac2f0ebf5}{00093}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_a5bb772b5fbc470c30659b61ac2f0ebf5}{add\_ratio\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg1,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00094}00094\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg2\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00095}00095\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ r;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00096}00096\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00097}00097\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)nadd\_ratio\_ratio:\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00098}00098\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg1,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00099}00099\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ +\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00100}00100\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg2,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00101}00101\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00102}00102\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ arg1\ )\ \&\&\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ arg2\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00103}00103\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell1\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ arg1\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00104}00104\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell2\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ arg2\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00105}00105\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00106}00106\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ divisor\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00107}00107\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a3f0fcaa092a0c6830aa0bf7303ed1f7c}{multiply\_integers}}(\ cell1-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00108}00108\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cell2-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00109}00109\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ dividend\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00110}00110\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a8b6e93c44eca207d8f88a71d90142bb9}{add\_integers}}(\ \mbox{\hyperlink{integer_8c_a3f0fcaa092a0c6830aa0bf7303ed1f7c}{multiply\_integers}}(\ cell1-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00111}00111\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cell2-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00112}00112\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a3f0fcaa092a0c6830aa0bf7303ed1f7c}{multiply\_integers}}(\ cell2-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00113}00113\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cell1-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ )\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00114}00114\ \ \ \ \ \ \ \ \ r\ =\ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ dividend,\ divisor,\ \textcolor{keyword}{true}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00115}00115\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00116}00116\ \ \ \ \ \ \ \ \ r\ =\ \mbox{\hyperlink{lispops_8c_a24b5ba8eb0cb1705e44fdf3cd90d6f75}{throw\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00117}00117\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Shouldn't\ happen:\ bad\ arg\ to\ add\_ratio\_ratio"{}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00118}00118\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ arg1,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00119}00119\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ arg2,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ )\ )\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00120}00120\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00121}00121\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00122}00122\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00123}00123\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}add\_ratio\_ratio\ =>\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00124}00124\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ r,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00125}00125\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)n"{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00126}00126\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00127}00127\ \ \ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00128}00128\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00129}00129\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00130}00130\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00131}00131\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00132}00132\ \textcolor{comment}{\ *\ return\ a\ cons\_pointer\ indicating\ a\ number\ which\ is\ the\ sum\ of}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00133}00133\ \textcolor{comment}{\ *\ the\ intger\ indicated\ by\ \`{}intarg`\ and\ the\ ratio\ indicated\ by}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00134}00134\ \textcolor{comment}{\ *\ \`{}ratarg`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00135}00135\ \textcolor{comment}{\ *\ @exception\ if\ either\ \`{}intarg`\ or\ \`{}ratarg`\ is\ not\ of\ the\ expected\ type.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00136}00136\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00137}\mbox{\hyperlink{ratio_8c_a970e02ec84fab27b4d33150eb50bdc8e}{00137}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_a970e02ec84fab27b4d33150eb50bdc8e}{add\_integer\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ intarg,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00138}00138\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ ratarg\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00139}00139\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00140}00140\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00141}00141\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)nadd\_integer\_ratio:\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00142}00142\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ intarg,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00143}00143\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ +\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00144}00144\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ ratarg,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00145}00145\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00146}00146\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_af99c355c0b2f78228a1e9e4e68dcfe76}{integerp}}(\ intarg\ )\ \&\&\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ ratarg\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00147}00147\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ one\ =\ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ 1,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00148}00148\ \ \ \ \ \ \ \ \ \ \ \ \ ratio\ =\ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ intarg,\ one,\ \textcolor{keyword}{false}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00149}00149\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00150}00150\ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{ratio_8c_a5bb772b5fbc470c30659b61ac2f0ebf5}{add\_ratio\_ratio}}(\ ratio,\ ratarg\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00151}00151\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00152}00152\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a6888967abc1be479f518354bb802d01d}{release\_integer}}(\ one\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00153}00153\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_aecb4a52465163e0377356bcaa85539bf}{dec\_ref}}(\ ratio\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00154}00154\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00155}00155\ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00156}00156\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{lispops_8c_a24b5ba8eb0cb1705e44fdf3cd90d6f75}{throw\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00157}00157\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Shouldn't\ happen:\ bad\ arg\ to\ add\_integer\_ratio"{}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00158}00158\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ intarg,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00159}00159\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_afff9c83c8c250837b5737c11e21cc4ca}{make\_cons}}(\ ratarg,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00160}00160\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ )\ )\ ),\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00161}00161\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00162}00162\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00163}00163\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ =>\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00164}00164\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ result,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00165}00165\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)n"{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00166}00166\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00167}00167\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00168}00168\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00169}00169\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00170}00170\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00171}00171\ \textcolor{comment}{\ *\ return\ a\ cons\_pointer\ to\ a\ ratio\ which\ represents\ the\ value\ of\ the\ ratio}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00172}00172\ \textcolor{comment}{\ *\ indicated\ by\ \`{}arg1`\ divided\ by\ the\ ratio\ indicated\ by\ \`{}arg2`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00173}00173\ \textcolor{comment}{\ *\ @exception\ will\ return\ an\ exception\ if\ either\ \`{}arg1`\ or\ \`{}arg2`\ is\ not\ a}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00174}00174\ \textcolor{comment}{\ *\ rational\ number.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00175}00175\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00176}\mbox{\hyperlink{ratio_8c_a6edf067028767b399bdc4181b0b808d4}{00176}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_a6edf067028767b399bdc4181b0b808d4}{divide\_ratio\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg1,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00177}00177\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg2\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00178}00178\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)ndivide\_ratio\_ratio:\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00179}00179\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg1,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00180}00180\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ /\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00181}00181\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg2,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00182}00182\ \ \ \ \ \textcolor{comment}{//\ TODO:\ this\ now\ has\ to\ work\ if\ \`{}arg1`\ is\ an\ integer}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00183}00183\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ i\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00184}00184\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ arg2\ ).payload.ratio.divisor,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00185}00185\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ arg2\ ).payload.ratio.dividend,\ \textcolor{keyword}{false}\ ),\ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00186}00186\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{ratio_8c_a60ef7247767c19d1ec458406366561fb}{multiply\_ratio\_ratio}}(\ arg1,\ i\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00187}00187\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00188}00188\ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_aecb4a52465163e0377356bcaa85539bf}{dec\_ref}}(\ i\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00189}00189\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00190}00190\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ =>\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00191}00191\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ result,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00192}00192\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)n"{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00193}00193\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00194}00194\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00195}00195\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00196}00196\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00197}00197\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00198}00198\ \textcolor{comment}{\ *\ return\ a\ cons\_pointer\ indicating\ a\ number\ which\ is\ the\ product\ of}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00199}00199\ \textcolor{comment}{\ *\ the\ ratios\ indicated\ by\ \`{}arg1`\ and\ \`{}arg2`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00200}00200\ \textcolor{comment}{\ *\ @exception\ will\ return\ an\ exception\ if\ either\ \`{}arg1`\ or\ \`{}arg2`\ is\ not\ a}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00201}00201\ \textcolor{comment}{\ *\ rational\ number.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00202}00202\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00203}\mbox{\hyperlink{ratio_8c_a60ef7247767c19d1ec458406366561fb}{00203}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_a60ef7247767c19d1ec458406366561fb}{multiply\_ratio\_ratio}}(\ struct}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00204}00204\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg1,\ struct}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00205}00205\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg2\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00206}00206\ \ \ \ \ \textcolor{comment}{//\ TODO:\ this\ now\ has\ to\ work\ if\ arg1\ is\ an\ integer}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00207}00207\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00208}00208\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00209}00209\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}multiply\_ratio\_ratio(\ arg1\ =\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00210}00210\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg1,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00211}00211\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{};\ arg2\ =\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00212}00212\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg2,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00213}00213\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{})\(\backslash\)n"{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00214}00214\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00215}00215\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ arg1\ )\ \&\&\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ arg2\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00216}00216\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ cell1\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ arg1\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00217}00217\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ cell2\ =\ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ arg2\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00218}00218\ \ \ \ \ \ \ \ \ int64\_t\ dd1v\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00219}00219\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cell1.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend\ ).payload.integer.value,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00220}00220\ \ \ \ \ \ \ \ \ \ \ \ \ dd2v\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00221}00221\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cell2.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend\ ).payload.integer.value,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00222}00222\ \ \ \ \ \ \ \ \ \ \ \ \ dr1v\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00223}00223\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cell1.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ ).payload.integer.value,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00224}00224\ \ \ \ \ \ \ \ \ \ \ \ \ dr2v\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00225}00225\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ cell2.\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ ).payload.integer.value,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00226}00226\ \ \ \ \ \ \ \ \ \ \ \ \ ddrv\ =\ dd1v\ *\ dd2v,\ drrv\ =\ dr1v\ *\ dr2v;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00227}00227\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00228}00228\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ dividend\ =\ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ ddrv,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00229}00229\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ divisor\ =\ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ drrv,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00230}00230\ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ dividend,\ divisor,\ \textcolor{keyword}{true}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00231}00231\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00232}00232\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a6888967abc1be479f518354bb802d01d}{release\_integer}}(\ dividend\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00233}00233\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a6888967abc1be479f518354bb802d01d}{release\_integer}}(\ divisor\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00234}00234\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00235}00235\ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00236}00236\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{lispops_8c_a24b5ba8eb0cb1705e44fdf3cd90d6f75}{throw\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00237}00237\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Shouldn't\ happen:\ bad\ arg\ to\ multiply\_ratio\_ratio"{}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00238}00238\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00239}00239\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00240}00240\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00241}00241\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ =>\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00242}00242\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ result,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00243}00243\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)n"{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00244}00244\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00245}00245\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00246}00246\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00247}00247\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00248}00248\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00249}00249\ \textcolor{comment}{\ *\ return\ a\ cons\_pointer\ indicating\ a\ number\ which\ is\ the\ product\ of}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00250}00250\ \textcolor{comment}{\ *\ the\ intger\ indicated\ by\ \`{}intarg`\ and\ the\ ratio\ indicated\ by}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00251}00251\ \textcolor{comment}{\ *\ \`{}ratarg`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00252}00252\ \textcolor{comment}{\ *\ @exception\ if\ either\ \`{}intarg`\ or\ \`{}ratarg`\ is\ not\ of\ the\ expected\ type.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00253}00253\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00254}\mbox{\hyperlink{ratio_8c_a921ee5ce45e59014688c02bca2397b98}{00254}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_a921ee5ce45e59014688c02bca2397b98}{multiply\_integer\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ intarg,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00255}00255\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ ratarg\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00256}00256\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00257}00257\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00258}00258\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)nmultiply\_integer\_ratio:\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00259}00259\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ intarg,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00260}00260\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ *\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00261}00261\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ ratarg,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00262}00262\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00263}00263\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_af99c355c0b2f78228a1e9e4e68dcfe76}{integerp}}(\ intarg\ )\ \&\&\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ ratarg\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00264}00264\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ one\ =\ \mbox{\hyperlink{integer_8c_adda818b0d598bdb572e371cb6d4123b4}{acquire\_integer}}(\ 1,\ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00265}00265\ \ \ \ \ \ \ \ \ \ \ \ \ ratio\ =\ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ intarg,\ one,\ \textcolor{keyword}{false}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00266}00266\ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{ratio_8c_a60ef7247767c19d1ec458406366561fb}{multiply\_ratio\_ratio}}(\ ratio,\ ratarg\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00267}00267\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00268}00268\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a6888967abc1be479f518354bb802d01d}{release\_integer}}(\ one\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00269}00269\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00270}00270\ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00271}00271\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{lispops_8c_a24b5ba8eb0cb1705e44fdf3cd90d6f75}{throw\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00272}00272\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Shouldn't\ happen:\ bad\ arg\ to\ multiply\_integer\_ratio"{}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00273}00273\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00274}00274\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00275}00275\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00276}00276\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ =>\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00277}00277\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ result,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00278}00278\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)n"{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00279}00279\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00280}00280\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00281}00281\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00282}00282\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00283}00283\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00284}00284\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00285}00285\ \textcolor{comment}{\ *\ return\ a\ cons\_pointer\ indicating\ a\ number\ which\ is\ the\ difference\ of}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00286}00286\ \textcolor{comment}{\ *\ the\ ratios\ indicated\ by\ \`{}arg1`\ and\ \`{}arg2`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00287}00287\ \textcolor{comment}{\ *\ @exception\ will\ return\ an\ exception\ if\ either\ \`{}arg1`\ or\ \`{}arg2`\ is\ not\ a}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00288}00288\ \textcolor{comment}{\ *\ rational\ number.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00289}00289\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00290}\mbox{\hyperlink{ratio_8c_ac58f726144640d5bce62d7e5e3eaae45}{00290}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_ac58f726144640d5bce62d7e5e3eaae45}{subtract\_ratio\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg1,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00291}00291\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ arg2\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00292}00292\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)nsubtract\_ratio\_ratio:\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00293}00293\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg1,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00294}00294\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ *\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00295}00295\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ arg2,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00296}00296\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00297}00297\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ i\ =\ \mbox{\hyperlink{peano_8c_a471edde763902818d541e02cb9d83b60}{negative}}(\ arg2\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00298}00298\ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{ratio_8c_a5bb772b5fbc470c30659b61ac2f0ebf5}{add\_ratio\_ratio}}(\ arg1,\ i\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00299}00299\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00300}00300\ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_aecb4a52465163e0377356bcaa85539bf}{dec\_ref}}(\ i\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00301}00301\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00302}00302\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00303}00303\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00304}00304\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00305}00305\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00306}00306\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00307}00307\ \textcolor{comment}{\ *\ Construct\ a\ ratio\ frame\ from\ this\ \`{}dividend`\ and\ \`{}divisor`,\ expected\ to}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00308}00308\ \textcolor{comment}{\ *\ be\ integers,\ in\ the\ context\ of\ the\ stack\_frame\ indicated\ by\ this}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00309}00309\ \textcolor{comment}{\ *\ \`{}frame\_pointer`.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00310}00310\ \textcolor{comment}{\ *\ @exception\ if\ either\ \`{}dividend`\ or\ \`{}divisor`\ is\ not\ an\ integer.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00311}00311\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00312}\mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{00312}}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ \mbox{\hyperlink{ratio_8c_ad2832e83566ce131e54397c3e165899c}{make\_ratio}}(\ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ dividend,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00313}00313\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ struct\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ divisor,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00314}00314\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bool\ simplify\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00315}00315\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}make\_ratio:\ dividend\ =\ "{}},\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00316}00316\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ dividend,\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00317}00317\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{};\ divisor\ =\ "{}},\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00318}00318\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ divisor,\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00319}00319\ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}},\ L\textcolor{stringliteral}{"{};\ simplify\ =\ \%d\(\backslash\)n"{}},\ simplify);}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00320}00320\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00321}00321\ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00322}00322\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_af99c355c0b2f78228a1e9e4e68dcfe76}{integerp}}(\ dividend\ )\ \&\&\ \mbox{\hyperlink{consspaceobject_8h_af99c355c0b2f78228a1e9e4e68dcfe76}{integerp}}(\ divisor\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00323}00323\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_aa38b760ee4493c5d98400e04db3c8d47}{inc\_ref}}(\ dividend\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00324}00324\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_aa38b760ee4493c5d98400e04db3c8d47}{inc\_ref}}(\ divisor\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00325}00325\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ unsimplified\ =\ \mbox{\hyperlink{conspage_8c_a04ba7c874b05e9789d0aca9ee6b106a7}{allocate\_cell}}(\ \mbox{\hyperlink{consspaceobject_8h_a63bde20c8b029f5ac3ffd93b36dfddc9}{RATIOTV}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00326}00326\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ unsimplified\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00327}00327\ \ \ \ \ \ \ \ \ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend\ =\ dividend;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00328}00328\ \ \ \ \ \ \ \ \ cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ =\ divisor;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00329}00329\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00330}00330\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ simplify)\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00331}00331\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{ratio_8c_ad84390b94da6403a93728b6b9d5503f0}{simplify\_ratio}}(\ unsimplified\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00332}00332\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ !\mbox{\hyperlink{equal_8c_ae8c9b7a5b6a556dbb30ae27d4c776d32}{eq}}(\ result,\ unsimplified\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00333}00333\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_aecb4a52465163e0377356bcaa85539bf}{dec\_ref}}(\ unsimplified\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00334}00334\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00335}00335\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00336}00336\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =\ unsimplified;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00337}00337\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00338}00338\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00339}00339\ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00340}00340\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{lispops_8c_a24b5ba8eb0cb1705e44fdf3cd90d6f75}{throw\_exception}}(\ \mbox{\hyperlink{consspaceobject_8h_a9e4202c8555763ca9a119f0d63a058cd}{c\_string\_to\_lisp\_string}}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00341}00341\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ L\textcolor{stringliteral}{"{}Dividend\ and\ divisor\ of\ a\ ratio\ must\ be\ integers"{}}\ ),}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00342}00342\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{consspaceobject_8h_a263efce0e5cda1d387a1a43f94715445}{NIL}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00343}00343\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00344}00344\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\ =>\ "{}},\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00345}00345\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ result,\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00346}00346\ \ \ \ \ \mbox{\hyperlink{debug_8c_a9d5aa8671cb579261b2049c09aafa773}{debug\_println}}(\ \mbox{\hyperlink{debug_8h_ab99ea81093661d24ffaaa4e85cb2387a}{DEBUG\_ALLOC}});}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00347}00347\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00348}00348\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00349}00349\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00350}00350\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00351}00351\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00352}00352\ \textcolor{comment}{\ *\ True\ if\ a\ and\ be\ are\ identical\ rationals,\ else\ false.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00353}00353\ \textcolor{comment}{\ *}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00354}00354\ \textcolor{comment}{\ *\ TODO:\ we\ need\ ways\ of\ checking\ whether\ rationals\ are\ equal}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00355}00355\ \textcolor{comment}{\ *\ to\ floats\ and\ to\ integers.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00356}00356\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00357}\mbox{\hyperlink{ratio_8c_a63c0888d86fd97b087a259dd507b618c}{00357}}\ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{ratio_8c_a63c0888d86fd97b087a259dd507b618c}{equal\_ratio\_ratio}}(\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ a,\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ b\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00358}00358\ \ \ \ \ \textcolor{keywordtype}{bool}\ result\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00359}00359\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00360}00360\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ a\ )\ \&\&\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ b\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00361}00361\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\_a\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ a\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00362}00362\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\_b\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ b\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00363}00363\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00364}00364\ \ \ \ \ \ \ \ \ result\ =\ \mbox{\hyperlink{integer_8c_a10c7e3258f3c46d3271301a7092fc52e}{equal\_integer\_integer}}(\ cell\_a-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00365}00365\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cell\_b-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend\ )\ \&\&}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00366}00366\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{integer_8c_a10c7e3258f3c46d3271301a7092fc52e}{equal\_integer\_integer}}(\ cell\_a-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00367}00367\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cell\_b-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00368}00368\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00369}00369\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00370}00370\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00371}00371\ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00372}00372\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00373}00373\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00374}00374\ \textcolor{comment}{\ *\ @brief\ convert\ a\ ratio\ to\ an\ equivalent\ long\ double.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00375}00375\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00376}00376\ \textcolor{comment}{\ *\ @param\ rat\ a\ pointer\ to\ a\ ratio.}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00377}00377\ \textcolor{comment}{\ *\ @return\ long\ double\ }}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00378}00378\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00379}\mbox{\hyperlink{ratio_8c_a0fe47053f1b1b94101748d354c1a76be}{00379}}\ \textcolor{keywordtype}{long}\ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{ratio_8c_a0fe47053f1b1b94101748d354c1a76be}{c\_ratio\_to\_ld}}(\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ rat\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00380}00380\ \ \ \ \ \textcolor{keywordtype}{long}\ \textcolor{keywordtype}{double}\ result\ =\ NAN;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00381}00381\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00382}00382\ \ \ \ \ \mbox{\hyperlink{debug_8c_ad55e4f61e076944d705d98b5314c5181}{debug\_print}}(\ L\textcolor{stringliteral}{"{}\(\backslash\)nc\_ratio\_to\_ld:\ "{}},\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00383}00383\ \ \ \ \ \mbox{\hyperlink{debug_8c_ada2d4646201b5827137d0bf053fcac59}{debug\_print\_object}}(\ rat,\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00384}00384\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00385}00385\ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a0517a5e5fa9a665e29005dcf51c1b081}{ratiop}}(\ rat\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00386}00386\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *cell\_a\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ rat\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00387}00387\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ dv\ =\ cell\_a-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.divisor;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00388}00388\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *dv\_cell\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ dv\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00389}00389\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__pointer}{cons\_pointer}}\ dd\ =\ cell\_a-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.ratio.dividend;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00390}00390\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{consspaceobject_8h_structcons__space__object}{cons\_space\_object}}\ *dd\_cell\ =\ \&\mbox{\hyperlink{consspaceobject_8h_af31e1da9438d7ae4410864ecc901b131}{pointer2cell}}(\ dd\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00391}00391\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00392}00392\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\ \mbox{\hyperlink{consspaceobject_8h_a758a42bfac22caaf66e29c666c91702d}{nilp}}(\ dv\_cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.more\ )}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00393}00393\ \ \ \ \ \ \ \ \ \ \ \ \ \ \&\&\ \mbox{\hyperlink{consspaceobject_8h_a758a42bfac22caaf66e29c666c91702d}{nilp}}(\ dd\_cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.more\ )\ )\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00394}00394\ \ \ \ \ \ \ \ \ \ \ \ \ result\ =}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00395}00395\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ (\ \textcolor{keywordtype}{long}\ double\ )\ dd\_cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.value\ )\ /}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00396}00396\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\ (\ \textcolor{keywordtype}{long}\ double\ )\ dv\_cell-\/>\mbox{\hyperlink{consspaceobject_8h_a259b3afe36776f8ba8498fdf95904f25}{payload}}.integer.value\ );;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00397}00397\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00398}00398\ \ \ \ \ \ \ \ \ \ \ \ \ fwprintf(\ stderr,}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00399}00399\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\textcolor{stringliteral}{"{}real\ conversion\ is\ not\ yet\ implemented\ for\ bignums\ rationals."{}}\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00400}00400\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00401}00401\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00402}00402\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00403}00403\ \ \ \ \ \mbox{\hyperlink{debug_8c_aa335b357cde1ba7eb6e8a71955079aab}{debug\_printf}}(\ \mbox{\hyperlink{debug_8h_a31067039d5f8f06bec3f2f94af168ed5}{DEBUG\_ARITH}},\ L\textcolor{stringliteral}{"{}\(\backslash\)nc\_ratio\_to\_ld\ returning\ \%d\(\backslash\)n"{}},\ result\ );}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00404}00404\ }
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00405}00405\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{ratio_8c_source_l00406}00406\ \}}

\end{DoxyCode}
