OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [compare-eq-const.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=gnu99" } */
2
 
3
/* C99 6.5.9 Equality operators.
4
   Compare decimal float constants against each other. */
5
 
6
extern void link_error (void);
7
 
8
int
9
main ()
10
{
11
  /* Compare like-typed positive constants. */
12
  if (2.0df != 2.0df)
13
    link_error ();
14
 
15
  /* Compare decimal float constants of different types. */
16
  if (500e-2dl != 0.05e2df)
17
    link_error ();
18
 
19
  /* Binary floating point introduces errors to decimal values. */
20
  if (1.4 + 1.4 + 1.4 == 4.2)
21
    link_error ();
22
 
23
  /* But, this looks more like what one would expect. */
24
  if (1.4dd + 1.4dd + 1.4dd != 4.2dd)
25
    link_error ();
26
 
27
  return 0;
28
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.