/[eiffelstudio]/branches/eth/eve/Src/Eiffel/API/evaluated_type/real_a.e
ViewVC logotype

Annotation of /branches/eth/eve/Src/Eiffel/API/evaluated_type/real_a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3181 - (hide annotations)
Tue Nov 21 16:40:33 1995 UTC (24 years, 2 months ago) by dinov
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/real_a.e
File size: 1606 byte(s)
reorganization in feature clauses

1 grator 18 -- Actual type for real type
2    
3     class REAL_A
4    
5     inherit
6    
7     BASIC_A
8     rename
9     internal_conform_to as old_conform_to
10     redefine
11 dinov 3078 is_real, associated_class, same_as, is_numeric, heaviest,
12     associated_eclass
13 grator 18 end;
14     BASIC_A
15     redefine
16 grator 296 is_real, associated_class, same_as, is_numeric, heaviest,
17 dinov 3078 internal_conform_to, associated_eclass
18 grator 18 select
19     internal_conform_to
20     end
21    
22 dinov 3078 feature -- Property
23    
24     is_real: BOOLEAN is
25     -- Is the current type a real type ?
26     do
27     Result := True;
28     end;
29    
30 dinov 3181 feature -- Access
31    
32 dinov 3078 associated_eclass: E_CLASS is
33     -- Associated eiffel class
34     once
35 dinov 3181 Result := System.real_class.compiled_eclass;
36 dinov 3078 end;
37    
38 dinov 3181 feature {COMPILER_EXPORTER}
39 grator 18
40     internal_conform_to (other: TYPE_A; in_generics: BOOLEAN): BOOLEAN is
41     -- Does `other' conform to Current ?
42     do
43     if in_generics then
44     Result := other.is_real;
45     else
46     Result := old_conform_to (other, False)
47     or else
48     other.actual_type.is_double
49     end;
50     end;
51    
52     is_numeric: BOOLEAN is
53     -- Is the current type a numeric type ?
54     do
55     Result := True;
56     end;
57    
58     heaviest (type: TYPE_A): TYPE_A is
59     -- Heaviest numeric type for balancing rule
60     do
61     if type.is_double then
62     Result := type
63     else
64     Result := Current
65     end;
66     end;
67    
68     type_i: FLOAT_I is
69     -- C type
70     once
71     Result := Float_c_type;
72     end;
73    
74     associated_class: CLASS_C is
75     -- Class REAL
76 grator 274 require else
77     real_class_compiled: System.real_class.compiled
78 grator 18 once
79     Result := System.real_class.compiled_class;
80     end;
81    
82     same_as (other: TYPE_A): BOOLEAN is
83     -- Is the current type the same as `other' ?
84     do
85     Result := other.is_real;
86     end;
87    
88     end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23