Understanding Intrinsic 'Fraction' Function in Fortran

  • Context: Fortran 
  • Thread starter Thread starter PaulDirac
  • Start date Start date
  • Tags Tags
    Response Strange
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 1K views
PaulDirac
Messages
33
Reaction score
4
I have tried to use the intrinsic' fraction' function in Fortran but have failed to understand how it works. I thought that it would return the fractional part of a real number, but when I ran a few numbers through it, I got something that was a far cry from what I expected. For example, I tried fraction(10.0) and got 0.625. Can you tell me what's wrong?
 
Physics news on Phys.org