0 Members and 2 Guests are viewing this topic.
float oneandahalf = 1.5f;double twoandahalf = 2.5;int one = 1;char str[60];sprintf(str, "1.5: %f 2.5: %f 1: %d", oneandahalf, twoandahalf, one);show_msgbox(str, str);
sprintf(str, "1: %d 2.5: %f 1.5: %f", 1, 2.5f, 1.5);
Nope, no change.Code: [Select]sprintf(str, "1: %d 2.5: %f 1.5: %f", 1, 2.5f, 1.5);prints: "1: 1 1.5: 0.000000 2.5: 0.000000".Seems to be some kind of issue with va_list's and aligning, doesn't it?
sprintf(str, "%d, %f, %lf", 1, 1.5f, 2.5);
Maybe GCC and Nucleus / TI's code use different formats for floating-point values ?
QuoteMaybe GCC and Nucleus / TI's code use different formats for floating-point values ?Is sprintf a syscall? Isn't it included in newlib?
sprintf is a syscall, yes. Ndless almost only uses syscalls and AFAIK doesn't use Newlib.