[Debian-lego-team] Bug#1065665: Bug#1065665: nxt-firmware: implicit type conversion from negative float to char gives 0
Petter Reinholdtsen
pere at hungry.com
Fri Mar 8 17:42:20 GMT 2024
[Andreas Weber]
> Dear Maintainer, following code debug1.nxc:
No idea about the nxt-firmware status, but just for fun and to show
support, I made a C edition:
% cat > x.c <<EOF
#include <stdio.h>
int main(int argc, char *argv[])
{
float a = -12.34;
printf("%f\n", a);
char b = a;
printf("%i\n", b);
return 0;
}
EOF
% gcc x.c
% ./a.out
-12.340000
-12
%
--
Happy hacking
Petter Reinholdtsen
More information about the Debian-lego-team
mailing list