PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/test/lib/numeric/number/test_number104.e

http://github.com/tybor/Liberty
Specman e | 89 lines | 55 code | 7 blank | 27 comment | 0 complexity | 3b968975f8fda6dab4b681b31f5bf200 MD5 | raw file
 1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
 2-- See the Copyright notice at the end of this file.
 3--
 4class TEST_NUMBER104
 5   --
 6   -- Test of depassement of INTEGER_64_NUMBER capacity
 7   -- during a multiplication between 2 INTEGER_64_NUMBER
 8   -- Result is an integer which is symbolized by a
 9   -- BIG_INTEGER_NUMBER
10   --
11
12insert
13   EIFFELTEST_TOOLS
14   ANY
15   PLATFORM
16
17create {}
18   make
19
20feature {ANY}
21   make
22      local
23         n: NUMBER
24      do
25         n := nt.from_integer_64(Maximum_integer_64)
26         n := n * nt.from_integer_64(2)
27         assert(n.is_integer_general_number)
28         assert(not n.is_integer_64)
29         assert(n.is_positive)
30         n := nt.from_integer_64(2)
31         n := n * nt.from_integer_64(Maximum_integer_64)
32         assert(n.is_integer_general_number)
33         assert(not n.is_integer_64)
34         assert(n.is_positive)
35         n := nt.from_integer_64(Maximum_integer_64)
36         n := n * nt.from_integer_64(-2)
37         assert(n.is_integer_general_number)
38         assert(not n.is_integer_64)
39         assert(not n.is_positive)
40         n := nt.from_integer_64(-2)
41         n := n * nt.from_integer_64(Maximum_integer_64)
42         assert(n.is_integer_general_number)
43         assert(not n.is_integer_64)
44         assert(not n.is_positive)
45         n := nt.from_integer_64(Minimum_integer_64)
46         n := n * nt.from_integer_64(2)
47         assert(n.is_integer_general_number)
48         assert(not n.is_integer_64)
49         assert(not n.is_positive)
50         n := nt.from_integer_64(2)
51         n := n * nt.from_integer_64(Minimum_integer_64)
52         assert(n.is_integer_general_number)
53         assert(not n.is_integer_64)
54         assert(not n.is_positive)
55         n := nt.from_integer_64(Minimum_integer_64)
56         n := n * nt.from_integer_64(-2)
57         assert(n.is_integer_general_number)
58         assert(not n.is_integer_64)
59         assert(n.is_positive)
60         n := nt.from_integer_64(-2)
61         n := n * nt.from_integer_64(Minimum_integer_64)
62         assert(n.is_integer_general_number)
63         assert(not n.is_integer_64)
64         assert(n.is_positive)
65      end
66
67
68
69   nt: NUMBER_TOOLS
70
71end -- class TEST_NUMBER104
72--
73-- ------------------------------------------------------------------------------------------------------------------------------
74-- Copyright notice below. Please read.
75--
76-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
77-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
78-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
79-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
80-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
81-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
82--
83-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
84-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
85--
86-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
87--
88-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
89-- ------------------------------------------------------------------------------------------------------------------------------