fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(int argc, const char * argv[])
  5. {
  6.  
  7. double perp_wall_dist[3] = {3.078403, 3.068661, 3.058981 };
  8. double ray_dir_y[3] = {0.649688, 0.651750, 0.653813 };
  9.  
  10. for(int i = 0; i < 3; ++i)
  11. {
  12. printf("perp_wall == %f , ray_dir = %f, dou*dou == %f\n",
  13. perp_wall_dist[i], ray_dir_y[i], perp_wall_dist[i] * ray_dir_y[i]);
  14. printf("perp_wall == %.12lf , ray_dir = %.12f, dou*dou == %.12f\n\n",
  15. perp_wall_dist[i], ray_dir_y[i], perp_wall_dist[i] * ray_dir_y[i]);
  16. }
  17.  
  18. }
  19.  
Success #stdin #stdout 0s 9416KB
stdin
Standard input is empty
stdout
perp_wall == 3.078403 ,  ray_dir = 0.649688, dou*dou == 2.000001
perp_wall == 3.078403000000 ,  ray_dir = 0.649688000000, dou*dou == 2.000001488264

perp_wall == 3.068661 ,  ray_dir = 0.651750, dou*dou == 2.000000
perp_wall == 3.068661000000 ,  ray_dir = 0.651750000000, dou*dou == 1.999999806750

perp_wall == 3.058981 ,  ray_dir = 0.653813, dou*dou == 2.000002
perp_wall == 3.058981000000 ,  ray_dir = 0.653813000000, dou*dou == 2.000001544553