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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [nosigned_zero_1.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
!
3
! PR fortran/40675
4
!
5
! Fortran 77 just had: "The value of a signed zero is the same as
6
! the value of an unsigned zero." and g77 returned for SIGN(1.0, -0.0) = 1.0
7
!
8
! Fortran 95+ has for SIGN: "Case  (iv):  If B is of type real and is zero,
9
! then ... (c) If B is negative real zero, the value of the result is -|A|".
10
! On architectures, where signed zeros are supported, gfortran's SIGN thus
11
! returns for B=-0.0 the -|A|.
12
!
13
program s
14
   x = sign(1.,0.)
15
   y = sign(1.,-0.)
16
   if (x /=  1.) call abort()
17
   if (y /= -1.) call abort()
18
   x = 1.
19
   y = 0.
20
   x = sign(x, y)
21
   y = sign(x, -y)
22
   if (x /=  1.) call abort()
23
   if (y /= -1.) call abort()
24
end program s

powered by: WebSVN 2.1.0

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