xref: /llvm-project/polly/lib/External/isl/imath/tests/qmisc.tc (revision 658eb9e14264d48888ade0e3daf0b648f76c3f0e)
1## Miscellaneous rational arithmetic tests
2## Generated and verified by hand
3
4# Basic negation tests
5qneg:0,0:0
6qneg:0,=1:0
7qneg:1/37,15/16:-1/37
8qneg:65/18,=1:-65/18
9qneg:-6/7,=1:6/7
10
11# Basic absolute value tests
12qabs:0,0:0
13qabs:0,=1:0
14qabs:1/37,15/16:1/37
15qabs:-592384293849818/1000001,55:592384293849818/1000001
16
17# Reciprocal tests
18qrecip:0,0:$MP_UNDEF
19qrecip:1/2,5:2
20qrecip:-3/2,100/995:-2/3
21qrecip:655378011918000000,=1:1/655378011918000000
22
23# Reading decimal fractions
24qrdec:0,10:0
25qrdec:1.10000,10:11/10
26qrdec:1.01000,10:101/100
27qrdec:1001.001,10:1001001/1000
28qrdec:1001.001,2:73/8
29qrdec:12.05,10:241/20
30qrdec:-5.00138,10:-250069/50000
31qrdec:-00000.5,10:-1/2
32qrdec:.5,10:1/2
33qrdec:-.005,10:-1/200
34
35# Rational exponentiation
36qexpt:-5/8,0,0:1
37qexpt:-5/8,0,=1:1
38qexpt:13/8,0,0:1
39qexpt:13/8,0,=1:1
40qexpt:509252236125428/47889593208724507642867,0,0:1
41qexpt:509252236125428/47889593208724507642867,0,=1:1
42qexpt:-5/8,1,0:-5/8
43qexpt:-5/8,1,=1:-5/8
44qexpt:13/8,1,0:13/8
45qexpt:13/8,1,=1:13/8
46qexpt:509252236125428/47889593208724507642867,1,0:509252236125428/47889593208724507642867
47qexpt:509252236125428/47889593208724507642867,1,=1:509252236125428/47889593208724507642867
48qexpt:509252236125428/47889593208724507642867,4,15/39:67256115255216568118287656956157205834289880165948820377856/5259743820161714626344840164714583399959974116151536869550562774750827767486998189660536721
49qexpt:509252236125428/47889593208724507642867,4,=1:67256115255216568118287656956157205834289880165948820377856/5259743820161714626344840164714583399959974116151536869550562774750827767486998189660536721
50