Compare commits

..

2 Commits

Author SHA1 Message Date
c7f3ad5108 fix с for mk 2.1 2024-12-27 11:27:51 +03:00
4af7bb20a7 fix с for mk 2024-12-27 11:22:47 +03:00

View File

@ -31,11 +31,11 @@ int set_some_bits(void *dest, unsigned int val)
int main()
{
float var = 0;
uint32_t a=4095;
uint32_t b=2000;
uint32_t c=4095;
uint32_t d=0xffff;
float var = -0.1;
uint32_t a=4096;
uint32_t b=0x7fffffff;
uint32_t c=1<<(32-9);
uint32_t d=1<<(32-10);
int status = 0;
//~ scanf("%x%x%x%x", &a, &b, &c, &d); //a=4095, b=2000, c=4095, d=0xffff
set_all_bits(&a);
@ -45,13 +45,13 @@ int main()
set_all_bits(&a);
printf("set_all_bits a: %#X\n",a);
printf("vol = %f\n",var);
status = reset_some_bits(&var, b);
printf("reset_some_bits %d %#X %f\n",status, a, var);
status = reset_some_bits( &var, c );
printf("reset_some_bits %d %#X %f\n",status, a, var);
set_all_bits(&var);
status = reset_some_bits(&var, d);
printf("reset_some_bits %d %#X %f\n",status, a, var);
printf("reset_some_bits %d %#X %f\n",status, b, var);
status = reset_some_bits( &var, ~c );
printf("reset_some_bits %d %#X %f\n",status, c, var);
status = reset_some_bits(&var, ~d);
printf("reset_some_bits %d %#X %f\n",status, d, var);
return 0;
}