vak: (Знайка)
Serge Vakulenko ([personal profile] vak) wrote2023-01-14 02:45 pm

За что математики не любят компьютерную арифметику

#include <stdio.h>
int main ()
{
    if (-5.2 + 4.9 != -0.3) {
        printf("Oops!\n");
    }
    if (4.8 - 6.1 != -1.3) {
        printf("Oops!\n");
    }
    if (4.3 - 3.6 != 0.7) {
        printf("Oops!\n");
    }
}
Это мне надо было простенький тестик сварганить по работе, суммировать плавающие числа, а оно вон как боком выскочило.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org