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,976 of 5,127   
   Lawrence =?iso-8859-13?q?D=FFOlivei to pehache   
   Re: FRACTION() seems broken in gfortran    
   08 Sep 25 22:16:57   
   
   From: ldo@nz.invalid   
      
   On Mon, 8 Sep 2025 15:25:28 +0200, pehache wrote:   
      
   > Le 17/08/2025 à 09:15, Lawrence D’Oliveiro a écrit :   
   >>   
   >> The way you describe is obviously the most natural interpretation,   
   >> these days. And most other languages do it that way. But not   
   >> Fortran.   
   >   
   > Can you elaborate on what these "most other languages" are ? I   
   > cannot find any intrinsic function that corresponds to the "most   
   > natural interpretation" in most of the popular languages around (C,   
   > C++, Pthon, Java, Rust, Matlab...)   
      
   Python doesn’t have a fraction() function as such, but it does have   
   modf , which is   
   documented as returning “the fractional and integer parts” of its   
   argument. Using the same examples as started this thread:   
      
       ldo@theon:~> python3 -ic "import math"   
       >>> math.modf(3.75)   
       (0.75, 3.0)   
       >>> math.modf(2.5)   
       (0.5, 2.0)   
      
   --- 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