@@ -70,6 +70,9 @@ pub trait RangeAllele:
7070 /// used to build a start exclusive range, by adding the increment to the start
7171 fn smallest_increment ( ) -> Self ;
7272
73+ /// Returns value 0 for iteration/counting
74+ fn zero ( ) -> Self ;
75+
7376 /// Returns value 1 for iteration/counting
7477 fn one ( ) -> Self ;
7578
@@ -95,6 +98,9 @@ impl RangeAllele for f32 {
9598 fn smallest_increment ( ) -> Self {
9699 f32:: EPSILON
97100 }
101+ fn zero ( ) -> Self {
102+ 0.0
103+ }
98104 fn one ( ) -> Self {
99105 1.0
100106 }
@@ -109,6 +115,9 @@ impl RangeAllele for f64 {
109115 fn smallest_increment ( ) -> Self {
110116 f64:: EPSILON
111117 }
118+ fn zero ( ) -> Self {
119+ 0.0
120+ }
112121 fn one ( ) -> Self {
113122 1.0
114123 }
@@ -123,6 +132,9 @@ impl RangeAllele for i8 {
123132 fn smallest_increment ( ) -> Self {
124133 1
125134 }
135+ fn zero ( ) -> Self {
136+ 0
137+ }
126138 fn one ( ) -> Self {
127139 1
128140 }
@@ -137,6 +149,9 @@ impl RangeAllele for i16 {
137149 fn smallest_increment ( ) -> Self {
138150 1
139151 }
152+ fn zero ( ) -> Self {
153+ 0
154+ }
140155 fn one ( ) -> Self {
141156 1
142157 }
@@ -151,6 +166,9 @@ impl RangeAllele for i32 {
151166 fn smallest_increment ( ) -> Self {
152167 1
153168 }
169+ fn zero ( ) -> Self {
170+ 0
171+ }
154172 fn one ( ) -> Self {
155173 1
156174 }
@@ -165,6 +183,9 @@ impl RangeAllele for u8 {
165183 fn smallest_increment ( ) -> Self {
166184 1
167185 }
186+ fn zero ( ) -> Self {
187+ 0
188+ }
168189 fn one ( ) -> Self {
169190 1
170191 }
@@ -179,6 +200,9 @@ impl RangeAllele for u16 {
179200 fn smallest_increment ( ) -> Self {
180201 1
181202 }
203+ fn zero ( ) -> Self {
204+ 0
205+ }
182206 fn one ( ) -> Self {
183207 1
184208 }
@@ -193,6 +217,9 @@ impl RangeAllele for u32 {
193217 fn smallest_increment ( ) -> Self {
194218 1
195219 }
220+ fn zero ( ) -> Self {
221+ 0
222+ }
196223 fn one ( ) -> Self {
197224 1
198225 }
0 commit comments