• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision203 (tree)
Time2019-03-11 22:34:32
Authorquiret

Log Message

- fixed a bug where numeric format of 0 would print out empty string (meow meow)

Change Summary

Incremental Difference

--- common/sdk/NumericFormat.h (revision 202)
+++ common/sdk/NumericFormat.h (revision 203)
@@ -214,17 +214,25 @@
214214 u_bitStream = bitStream;
215215 }
216216
217- // We build up the polynome in reverse order.
218- // Then we use the eir::String reverse method to turn it around.
219- while ( u_bitStream > 0 )
217+ if ( u_bitStream == 0 )
220218 {
221- unsigned int polynome_coeff = ( u_bitStream % base );
219+ // Just print out the zero.
220+ strOut += GetCharacterForNumeric <charType> ( 0 );
221+ }
222+ else
223+ {
224+ // We build up the polynome in reverse order.
225+ // Then we use the eir::String reverse method to turn it around.
226+ while ( u_bitStream > 0 )
227+ {
228+ unsigned int polynome_coeff = ( u_bitStream % base );
222229
223- // Move down all polynome entries by one.
224- u_bitStream /= base;
230+ // Move down all polynome entries by one.
231+ u_bitStream /= base;
225232
226- // Add this polynome value.
227- strOut += GetCharacterForNumeric <charType> ( polynome_coeff );
233+ // Add this polynome value.
234+ strOut += GetCharacterForNumeric <charType> ( polynome_coeff );
235+ }
228236 }
229237
230238 // Add a sign if required.
Show on old repository browser