Nervous ticks in C - a reminder of the cruel logic of logic [Software]
Hi ElMaestro,
very strange
using your code
in
https://www.onlinegdb.com/online_c_compiler
I got
x=0.000000
x=0.050000
x=0.100000
x=0.150000
x=0.200000
x=0.250000
as it should be
very strange
using your code
#include <stdio.h>
int Test10001(double x, double dx)
{
double xmax;
xmax=dx*ceil(x/dx);
x=0.0;
while (x<=xmax)
{
printf("x=%f\n",x);
x=x+dx;
}
return(0);
}
int main()
{
double x = 0.234567;
double dx = 0.05;
Test10001(x, dx);
return(0);
}
in
https://www.onlinegdb.com/online_c_compiler
I got
x=0.000000
x=0.050000
x=0.100000
x=0.150000
x=0.200000
x=0.250000
as it should be
—
Kind regards,
Mittyri
Kind regards,
Mittyri
Complete thread:
- Nervous ticks in C - a reminder of the cruel logic of logic ElMaestro 2018-03-15 10:24 [Software]
- Nervous ticks in C - a reminder of the cruel logic of logicmittyri 2018-03-15 11:55
- Binary representation ElMaestro 2018-03-16 13:13
- bypassing eqaulity conditions mittyri 2018-03-17 18:12
- Binary representation ElMaestro 2018-03-16 13:13
- Nervous ticks in C - a reminder of the cruel logic of logic nobody 2018-03-18 13:13
- Nervous ticks in C - a reminder of the cruel logic of logic ElMaestro 2018-03-19 09:44
- Nervous ticks in C - a reminder of the cruel logic of logic nobody 2018-03-22 08:56
- Check it out for yourself - Dissolution Bootstrap:-) ElMaestro 2018-03-22 17:16
- Check it out for yourself - Dissolution Bootstrap:-) Helmut 2018-03-22 18:50
- Check it out for yourself - Dissolution Bootstrap:-) ElMaestro 2018-03-22 19:04
- Check it out for yourself - Dissolution Bootstrap:-) Helmut 2018-03-22 22:22
- Check it out for yourself - Dissolution Bootstrap:-) ElMaestro 2018-03-22 19:04
- Check it out for yourself - Dissolution Bootstrap:-) Helmut 2018-03-22 18:50
- Check it out for yourself - Dissolution Bootstrap:-) ElMaestro 2018-03-22 17:16
- Nervous ticks in C - a reminder of the cruel logic of logic nobody 2018-03-22 08:56
- Nervous ticks in C - a reminder of the cruel logic of logic ElMaestro 2018-03-19 09:44
- Nervous ticks in C - a reminder of the cruel logic of logicmittyri 2018-03-15 11:55