UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


code:rprintf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
code:rprintf [2008/11/04 00:05] laurencebcode:rprintf [2008/11/06 01:59] (current) laurenceb
Line 7: Line 7:
 { {
  unsigned char firstplace = FALSE;  unsigned char firstplace = FALSE;
- unsigned char i=255, digit;+ unsigned char i=25, digit;
  double place = 1000000000000000.0;  double place = 1000000000000000.0;
  
Line 20: Line 20:
  if(digit | firstplace) //digit>=1  if(digit | firstplace) //digit>=1
  {  {
- firstplace = TRUE; //we have reached the first digit + firstplace = TRUE; //we have reached the first digit
  rprintfChar(digit+0x30);  rprintfChar(digit+0x30);
  }  }
Line 29: Line 29:
  rprintfChar('.'); //the decimal point  rprintfChar('.'); //the decimal point
  firstplace = TRUE; //we have to print after the decimal place  firstplace = TRUE; //we have to print after the decimal place
- i=numDigits;+ i=numDigits+1;
  }  }
  x-=digit*place;  x-=digit*place;
code/rprintf.1225757139.txt.gz · Last modified: 2008/11/04 00:05 by laurenceb

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki