Skip to content

Commit a2e7413

Browse files
committed
More efficient dtostrf() emulation on ARM
1 parent 81d41fc commit a2e7413

File tree

1 file changed

+2
-5
lines changed
  • hardware/arduino/sam/cores/arduino/avr

1 file changed

+2
-5
lines changed

hardware/arduino/sam/cores/arduino/avr/dtostrf.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020

2121
char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
2222
char fmt[20];
23-
if (width<0) {
24-
sprintf(fmt, "%%-%d.%df", width, prec);
25-
} else {
26-
sprintf(fmt, "%%%d.%df", width, prec);
27-
}
23+
sprintf(fmt, "%%%d.%df", width, prec);
2824
sprintf(sout, fmt, val);
2925
return sout;
3026
}
27+

0 commit comments

Comments
 (0)