home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,991 of 5,127   
   Me to Kay Diederichs   
   Re: FRACTION() seems broken in gfortran    
   15 Sep 25 20:34:42   
   
   From: Me@invalid.domain   
      
   On 19.08.2025 12:15, Kay Diederichs wrote:   
   >   
   > The following program, adapted from the Example in the documentation you   
   > cite:   
   >   
   > program test_fraction   
   >    real :: x   
   >    x = 3.75   
   >    print *, fraction(x), x   
   >    print *, x * radix(x)**(-exponent(x))   
   > end program test_fraction   
   >   
   > prints:   
   >    0.937500000       3.75000000   
   >     0.00000000   
   >   
   > but I was expecting it to print:   
   >    0.937500000       3.75000000   
   >    0.937500000   
   >   
   > because the documentation says that fraction(x) is the same as  x *   
   > radix(x)**(-exponent(x)) .   
      
   I just tested with Intel FORTRAN and yes it is as you expected   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca