Puzzle_code - else printf"Single precision not equal\n" if(dq == CVAL printf"Double precision equal\n" else printf"Double

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* puzzle.c * Why does this C program behave the way it does? */ #define CVAL 0.1 #include <stdio.h> int main() { float q = CVAL; double dq = CVAL; if (q == CVAL) printf("Single precision: equal!\n");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else printf("Single precision: not equal!\n"); if (dq == CVAL) printf("Double precision: equal!\n"); else printf("Double precision: not equal!\n"); return 0; }...
View Full Document

This note was uploaded on 09/29/2009 for the course COSC 1002 taught by Professor Wheatland during the Three '09 term at University of Sydney.

Ask a homework question - tutors are online