Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: fb39ca4 on August 07, 2011, 01:42:37 am

Title: Nspire printf syscall is not ANSI compliant
Post by: fb39ca4 on August 07, 2011, 01:42:37 am
I was trying to debug a program I was writing with printf, and realized it was giving me incorrect results when I tried doing printf("%f", 2.0); and it printed 0.000000. This means TI is being lazy and has not provided a full implementation of printf. Some other things I discovered were that the flag %Lf does not work (it just prints Lf), and that sprintf has the same issues. Could any other C developers help look into this and experiment so we can figure out the extent of these limitations?
Title: Re: Nspire printf syscall is not ANSI compliant
Post by: Lionel Debroux on August 07, 2011, 01:57:15 am
It's not compliant either on the TI-68k/AMS platform :)
Quote
This means TI is being lazy and has not provided a full implementation of printf.
Another possibility (which is not mutually exclusive with TI not providing a full implementation of printf, as shown by %Lf not being supported) is that floats have a non-standard calling convention, just like on the TI-68k/AMS platform, where float = double for most practical purposes.