proc addrat
	filen	rational.icn
	local	0,001000,r1
	local	1,001000,r2
	local	2,000020,denom
	local	3,000020,numer
	local	4,000020,div
	local	5,000000,ratred
	local	6,000000,rational
	local	7,000000,gcd
	local	8,000000,abs
	con	0,002000,1,0
	con	1,002000,1,1
	declend
	line	59
	colm	11
	mark	L1
	pnull
	var	0
	var	5
	var	0
	line	62
	colm	16
	invoke	1
	line	62
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	5
	var	1
	line	63
	colm	16
	invoke	1
	line	63
	colm	7
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	2
	pnull
	pnull
	var	0
	line	65
	colm	15
	field	denom
	pnull
	var	1
	line	65
	colm	26
	field	denom
	line	65
	colm	22
	mult
	line	65
	colm	10
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	3
	pnull
	pnull
	pnull
	pnull
	var	0
	line	66
	colm	15
	field	sign
	pnull
	var	0
	line	66
	colm	25
	field	numer
	line	66
	colm	21
	mult
	pnull
	var	1
	line	66
	colm	36
	field	denom
	line	66
	colm	32
	mult
	pnull
	pnull
	pnull
	var	1
	line	67
	colm	9
	field	sign
	pnull
	var	1
	line	67
	colm	19
	field	numer
	line	67
	colm	15
	mult
	pnull
	var	0
	line	67
	colm	30
	field	denom
	line	67
	colm	26
	mult
	line	66
	colm	43
	plus
	line	66
	colm	10
	asgn
	unmark
lab L4
	mark	L5
	mark0
	pnull
	var	3
	int	0
	line	69
	colm	13
	numeq
	unmark
	mark	L6
	var	6
	int	0
	int	1
	int	1
	line	69
	colm	38
	invoke	3
	line	69
	colm	22
	pret
lab L6
	pfail
	unmark
lab L5
	mark	L7
	pnull
	var	4
	var	7
	var	3
	var	2
	line	71
	colm	14
	invoke	2
	line	71
	colm	8
	asgn
	unmark
lab L7
	mark	L8
	mark	L9
	var	6
	var	8
	pnull
	var	3
	var	4
	line	73
	colm	30
	div
	line	73
	colm	23
	invoke	1
	var	8
	pnull
	var	2
	var	4
	line	73
	colm	48
	div
	line	73
	colm	41
	invoke	1
	pnull
	var	3
	var	8
	var	3
	line	73
	colm	67
	invoke	1
	line	73
	colm	62
	div
	line	73
	colm	19
	invoke	3
	line	73
	colm	4
	pret
lab L9
	pfail
	unmark
lab L8
	pnull
	line	75
	colm	1
	pfail
	end
proc divrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000000,ratred
	local	3,000000,mpyrat
	local	4,000000,reciprat
	declend
	line	77
	colm	11
	mark	L1
	pnull
	var	0
	var	2
	var	0
	line	79
	colm	16
	invoke	1
	line	79
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	2
	var	1
	line	80
	colm	16
	invoke	1
	line	80
	colm	7
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	var	3
	var	0
	var	4
	var	1
	line	82
	colm	30
	invoke	1
	line	82
	colm	17
	invoke	2
	line	82
	colm	4
	pret
lab L4
	pfail
	unmark
lab L3
	pnull
	line	84
	colm	1
	pfail
	end
proc medrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000020,numer
	local	3,000020,denom
	local	4,000020,div
	local	5,000000,ratred
	local	6,000000,gcd
	local	7,000000,rational
	declend
	line	86
	colm	11
	mark	L1
	pnull
	var	0
	var	5
	var	0
	line	89
	colm	16
	invoke	1
	line	89
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	5
	var	1
	line	90
	colm	16
	invoke	1
	line	90
	colm	7
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	2
	pnull
	pnull
	var	0
	line	92
	colm	15
	field	numer
	pnull
	var	1
	line	92
	colm	26
	field	numer
	line	92
	colm	22
	plus
	line	92
	colm	10
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	3
	pnull
	pnull
	var	0
	line	93
	colm	15
	field	denom
	pnull
	var	1
	line	93
	colm	26
	field	denom
	line	93
	colm	22
	plus
	line	93
	colm	10
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	4
	var	6
	var	2
	var	3
	line	95
	colm	14
	invoke	2
	line	95
	colm	8
	asgn
	unmark
lab L5
	mark	L6
	mark	L7
	var	7
	pnull
	var	2
	var	4
	line	97
	colm	26
	div
	pnull
	var	3
	var	4
	line	97
	colm	39
	div
	pnull
	pnull
	var	0
	line	97
	colm	48
	field	sign
	pnull
	var	1
	line	97
	colm	58
	field	sign
	line	97
	colm	54
	mult
	line	97
	colm	19
	invoke	3
	line	97
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	99
	colm	1
	pfail
	end
proc mpyrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000020,numer
	local	3,000020,denom
	local	4,000020,div
	local	5,000000,ratred
	local	6,000000,gcd
	local	7,000000,rational
	declend
	line	101
	colm	11
	mark	L1
	pnull
	var	0
	var	5
	var	0
	line	104
	colm	16
	invoke	1
	line	104
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	5
	var	1
	line	105
	colm	16
	invoke	1
	line	105
	colm	7
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	2
	pnull
	pnull
	var	0
	line	107
	colm	15
	field	numer
	pnull
	var	1
	line	107
	colm	26
	field	numer
	line	107
	colm	22
	mult
	line	107
	colm	10
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	3
	pnull
	pnull
	var	0
	line	108
	colm	15
	field	denom
	pnull
	var	1
	line	108
	colm	26
	field	denom
	line	108
	colm	22
	mult
	line	108
	colm	10
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	4
	var	6
	var	2
	var	3
	line	110
	colm	14
	invoke	2
	line	110
	colm	8
	asgn
	unmark
lab L5
	mark	L6
	mark	L7
	var	7
	pnull
	var	2
	var	4
	line	112
	colm	26
	div
	pnull
	var	3
	var	4
	line	112
	colm	39
	div
	pnull
	pnull
	var	0
	line	112
	colm	48
	field	sign
	pnull
	var	1
	line	112
	colm	58
	field	sign
	line	112
	colm	54
	mult
	line	112
	colm	19
	invoke	3
	line	112
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	114
	colm	1
	pfail
	end
proc negrat
	local	0,001000,r
	local	1,000000,ratred
	local	2,000000,rational
	declend
	line	116
	colm	11
	mark	L1
	pnull
	var	0
	var	1
	var	0
	line	118
	colm	15
	invoke	1
	line	118
	colm	6
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	var	2
	pnull
	var	0
	line	120
	colm	21
	field	numer
	pnull
	var	0
	line	120
	colm	30
	field	denom
	pnull
	pnull
	var	0
	line	120
	colm	40
	field	sign
	line	120
	colm	38
	neg
	line	120
	colm	19
	invoke	3
	line	120
	colm	4
	pret
lab L3
	pfail
	unmark
lab L2
	pnull
	line	122
	colm	1
	pfail
	end
proc rat2real
	local	0,001000,r
	local	1,000000,ratred
	local	2,000000,real
	declend
	line	124
	colm	11
	mark	L1
	pnull
	var	0
	var	1
	var	0
	line	126
	colm	15
	invoke	1
	line	126
	colm	6
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	pnull
	pnull
	var	2
	pnull
	var	0
	line	128
	colm	18
	field	numer
	line	128
	colm	16
	invoke	1
	pnull
	var	0
	line	128
	colm	29
	field	sign
	line	128
	colm	26
	mult
	pnull
	var	0
	line	128
	colm	39
	field	denom
	line	128
	colm	36
	div
	line	128
	colm	4
	pret
lab L3
	pfail
	unmark
lab L2
	pnull
	line	130
	colm	1
	pfail
	end
proc rat2str
	local	0,001000,r
	local	1,000000,ratred
	con	0,010000,1,050
	con	1,010000,1,057
	con	2,010000,1,051
	declend
	line	132
	colm	11
	mark	L1
	pnull
	var	0
	var	1
	var	0
	line	134
	colm	15
	invoke	1
	line	134
	colm	6
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	pnull
	pnull
	pnull
	pnull
	str	0
	pnull
	pnull
	var	0
	line	136
	colm	20
	field	numer
	pnull
	var	0
	line	136
	colm	30
	field	sign
	line	136
	colm	27
	mult
	line	136
	colm	15
	cat
	str	1
	line	136
	colm	37
	cat
	pnull
	var	0
	line	136
	colm	48
	field	denom
	line	136
	colm	44
	cat
	str	2
	line	136
	colm	55
	cat
	line	136
	colm	4
	pret
lab L3
	pfail
	unmark
lab L2
	pnull
	line	138
	colm	1
	pfail
	end
proc ratred
	local	0,001000,r
	local	1,000020,div
	local	2,000000,runerr
	local	3,000000,abs
	local	4,000000,rational
	local	5,000000,gcd
	con	0,002000,1,0
	con	1,002000,3,501
	con	2,002000,1,1
	declend
	line	140
	colm	11
	mark	L1
	mark0
	pnull
	pnull
	var	0
	line	143
	colm	8
	field	denom
	int	0
	line	143
	colm	15
	numeq
	unmark
	var	2
	int	1
	line	143
	colm	30
	invoke	1
	unmark
lab L1
	mark	L2
	mark0
	pnull
	var	3
	pnull
	var	0
	line	144
	colm	12
	field	sign
	line	144
	colm	10
	invoke	1
	int	2
	line	144
	colm	19
	numne
	unmark
	var	2
	int	1
	line	144
	colm	35
	invoke	1
	unmark
lab L2
	mark	L3
	mark0
	pnull
	pnull
	var	0
	line	146
	colm	8
	field	numer
	int	0
	line	146
	colm	15
	numeq
	unmark
	mark	L4
	var	4
	int	0
	int	2
	int	2
	line	146
	colm	39
	invoke	3
	line	146
	colm	24
	pret
lab L4
	pfail
	unmark
lab L3
	mark	L5
	mark0
	pnull
	pnull
	var	0
	line	148
	colm	8
	field	numer
	int	0
	line	148
	colm	15
	numlt
	unmark
	pnull
	pnull
	var	0
	line	148
	colm	25
	field	sign
	dup
	pnull
	int	2
	line	148
	colm	35
	neg
	line	148
	colm	31
	mult
	asgn
	unmark
lab L5
	mark	L6
	mark0
	pnull
	pnull
	var	0
	line	149
	colm	8
	field	denom
	int	0
	line	149
	colm	15
	numlt
	unmark
	pnull
	pnull
	var	0
	line	149
	colm	25
	field	sign
	dup
	pnull
	int	2
	line	149
	colm	35
	neg
	line	149
	colm	31
	mult
	asgn
	unmark
lab L6
	mark	L7
	pnull
	pnull
	var	0
	line	151
	colm	5
	field	numer
	var	3
	pnull
	var	0
	line	151
	colm	20
	field	numer
	line	151
	colm	18
	invoke	1
	line	151
	colm	12
	asgn
	unmark
lab L7
	mark	L8
	pnull
	pnull
	var	0
	line	152
	colm	5
	field	denom
	var	3
	pnull
	var	0
	line	152
	colm	20
	field	denom
	line	152
	colm	18
	invoke	1
	line	152
	colm	12
	asgn
	unmark
lab L8
	mark	L9
	pnull
	var	1
	var	5
	pnull
	var	0
	line	154
	colm	16
	field	numer
	pnull
	var	0
	line	154
	colm	25
	field	denom
	line	154
	colm	14
	invoke	2
	line	154
	colm	8
	asgn
	unmark
lab L9
	mark	L10
	mark	L11
	var	4
	pnull
	pnull
	var	0
	line	156
	colm	21
	field	numer
	var	1
	line	156
	colm	28
	div
	pnull
	pnull
	var	0
	line	156
	colm	36
	field	denom
	var	1
	line	156
	colm	43
	div
	pnull
	var	0
	line	156
	colm	51
	field	sign
	line	156
	colm	19
	invoke	3
	line	156
	colm	4
	pret
lab L11
	pfail
	unmark
lab L10
	pnull
	line	158
	colm	1
	pfail
	end
proc real2rat
	local	0,001000,r
	local	1,001000,p
	local	2,000020,t
	local	3,000020,d
	local	4,000020,i
	local	5,000020,j
	local	6,000040,x
	local	7,000040,y
	local	8,000000,list
	local	9,000000,abs
	local	10,000000,integer
	local	11,000000,real
	local	12,000000,rational
	con	0,002000,2,40
	con	1,002000,1,2
	con	2,004000,1e-10
	con	3,002000,1,1
	con	4,002000,1,0
	con	5,004000,1.0
	declend
	line	168
	colm	11
	init	L1
	mark	L1
	mark	L2
	pnull
	var	6
	var	8
	int	0
	line	171
	colm	23
	invoke	1
	line	171
	colm	16
	asgn
	unmark
lab L2
	pnull
	var	7
	var	8
	pnull
	int	0
	int	1
	line	171
	colm	42
	plus
	line	171
	colm	38
	invoke	1
	line	171
	colm	31
	asgn
	unmark
lab L1
	mark	L3
	pnull
	var	2
	var	9
	var	0
	line	173
	colm	12
	invoke	1
	line	173
	colm	6
	asgn
	unmark
lab L3
	mark	L4
	pnull
	pnull
	var	1
	line	174
	colm	4
	null
	real	2
	line	174
	colm	7
	asgn
	unmark
lab L4
	mark	L5
	mark0
	pnull
	var	4
	pnull
	int	3
	int	0
	push1
	line	175
	colm	17
	toby
	line	175
	colm	12
	asgn
	pop
	mark0
	mark	L8
	pnull
	pnull
	var	6
	var	4
	line	176
	colm	8
	subsc
	var	10
	var	2
	line	176
	colm	22
	invoke	1
	line	176
	colm	12
	asgn
	unmark
lab L8
	mark	L9
	pnull
	pnull
	var	7
	pnull
	var	4
	int	3
	line	177
	colm	11
	plus
	line	177
	colm	8
	subsc
	int	3
	line	177
	colm	16
	asgn
	unmark
lab L9
	mark	L10
	pnull
	pnull
	var	7
	pnull
	var	4
	int	1
	line	178
	colm	11
	plus
	line	178
	colm	8
	subsc
	int	4
	line	178
	colm	16
	asgn
	unmark
lab L10
	mark	L11
	mark0
	pnull
	var	5
	pnull
	var	4
	int	3
	pnull
	int	3
	line	179
	colm	28
	neg
	line	179
	colm	20
	toby
	line	179
	colm	15
	asgn
	pop
	mark0
	pnull
	pnull
	var	7
	var	5
	line	180
	colm	11
	subsc
	pnull
	pnull
	pnull
	var	6
	var	5
	line	180
	colm	19
	subsc
	pnull
	var	7
	pnull
	var	5
	int	3
	line	180
	colm	29
	plus
	line	180
	colm	26
	subsc
	line	180
	colm	23
	mult
	pnull
	var	7
	pnull
	var	5
	int	1
	line	180
	colm	40
	plus
	line	180
	colm	37
	subsc
	line	180
	colm	34
	plus
	line	180
	colm	15
	asgn
	unmark
lab L12
	efail
lab L13
	unmark
lab L11
	mark	L14
	mark0
	pnull
	var	9
	pnull
	pnull
	pnull
	var	7
	int	3
	line	181
	colm	15
	subsc
	var	11
	pnull
	var	7
	int	1
	line	181
	colm	27
	subsc
	line	181
	colm	25
	invoke	1
	line	181
	colm	19
	div
	var	0
	line	181
	colm	32
	minus
	line	181
	colm	13
	invoke	1
	var	1
	line	181
	colm	37
	numlt
	unmark
	unmark
	unmark
	unmark
	pnull
	goto	L7
	unmark
lab L14
	mark	L15
	pnull
	var	3
	pnull
	var	2
	var	10
	var	2
	line	182
	colm	23
	invoke	1
	line	182
	colm	14
	minus
	line	182
	colm	9
	asgn
	unmark
lab L15
	mark	L16
	mark0
	pnull
	var	3
	var	1
	line	183
	colm	12
	numlt
	unmark
	unmark
	unmark
	unmark
	pnull
	goto	L7
	unmark
lab L16
	pnull
	var	2
	pnull
	real	5
	var	3
	line	184
	colm	16
	div
	line	184
	colm	9
	asgn
	unmark
lab L6
	efail
lab L7
	unmark
lab L5
	mark	L17
	mark	L18
	var	12
	pnull
	var	7
	int	3
	line	186
	colm	21
	subsc
	pnull
	var	7
	int	1
	line	186
	colm	27
	subsc
	mark	L19
	pnull
	var	0
	int	4
	line	186
	colm	37
	numge
	unmark
	int	3
	goto	L20
lab L19
	pnull
	int	3
	line	186
	colm	54
	neg
lab L20
	line	186
	colm	19
	invoke	3
	line	186
	colm	4
	pret
lab L18
	pfail
	unmark
lab L17
	pnull
	line	188
	colm	1
	pfail
	end
proc reciprat
	local	0,001000,r
	local	1,000000,ratred
	local	2,000000,rational
	declend
	line	190
	colm	11
	mark	L1
	pnull
	var	0
	var	1
	var	0
	line	192
	colm	15
	invoke	1
	line	192
	colm	6
	asgn
	unmark
lab L1
	mark	L2
	mark	L3
	var	2
	pnull
	var	0
	line	194
	colm	21
	field	denom
	pnull
	var	0
	line	194
	colm	30
	field	numer
	pnull
	var	0
	line	194
	colm	39
	field	sign
	line	194
	colm	19
	invoke	3
	line	194
	colm	4
	pret
lab L3
	pfail
	unmark
lab L2
	pnull
	line	196
	colm	1
	pfail
	end
proc str2rat
	local	0,001000,s
	local	1,000020,div
	local	2,000020,numer
	local	3,000020,denom
	local	4,000020,sign
	local	5,000000,integer
	local	6,000000,tab
	local	7,000000,upto
	local	8,000000,move
	local	9,000000,pos
	local	10,000000,ratred
	local	11,000000,rational
	con	0,010000,1,050
	con	1,020000,1,057
	con	2,002000,1,1
	con	3,020000,1,051
	declend
	line	198
	colm	11
	mark	L1
	var	0
	line	201
	colm	6
	bscan
	mark	L2
	pnull
	str	0
	line	202
	colm	7
	tabmat
	pop
	pnull
	var	2
	var	5
	var	6
	var	7
	cset	1
	line	203
	colm	32
	invoke	1
	line	203
	colm	27
	invoke	1
	line	203
	colm	23
	invoke	1
	line	203
	colm	13
	asgn
	pop
	var	8
	int	2
	line	204
	colm	11
	invoke	1
	pop
	pnull
	var	3
	var	5
	var	6
	var	7
	cset	3
	line	205
	colm	32
	invoke	1
	line	205
	colm	27
	invoke	1
	line	205
	colm	23
	invoke	1
	line	205
	colm	13
	asgn
	pop
	var	9
	pnull
	int	2
	line	206
	colm	11
	neg
	line	206
	colm	10
	invoke	1
	esusp
	goto	L3
lab L2
	line	207
	colm	11
	pfail
lab L3
	line	201
	colm	6
	escan
	unmark
lab L1
	mark	L4
	mark	L5
	var	10
	var	11
	var	2
	var	3
	int	2
	line	209
	colm	26
	invoke	3
	line	209
	colm	17
	invoke	1
	line	209
	colm	4
	pret
lab L5
	pfail
	unmark
lab L4
	pnull
	line	211
	colm	1
	pfail
	end
proc subrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000000,ratred
	local	3,000000,addrat
	local	4,000000,negrat
	declend
	line	213
	colm	11
	mark	L1
	pnull
	var	0
	var	2
	var	0
	line	215
	colm	16
	invoke	1
	line	215
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	2
	var	1
	line	216
	colm	16
	invoke	1
	line	216
	colm	7
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	var	3
	var	0
	var	4
	var	1
	line	218
	colm	28
	invoke	1
	line	218
	colm	17
	invoke	2
	line	218
	colm	4
	pret
lab L4
	pfail
	unmark
lab L3
	pnull
	line	220
	colm	1
	pfail
	end
