# Finding properties of numeric kinds

**URL:** <https://fortran-lang.discourse.group/t/finding-properties-of-numeric-kinds/8814>\
**Category:** Compilers\
**Created:** [November 7, 2024, 10:10pm UTC](https://fortran-lang.discourse.group/t/finding-properties-of-numeric-kinds/8814 "2024-11-07T22:10:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harper](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Harper](https://fortran-lang.discourse.group/u/Harper)\
**Post date:** [November 7, 2024, 10:10pm UTC](https://fortran-lang.discourse.group/t/finding-properties-of-numeric-kinds/8814/1 "2024-11-07T22:10:33Z")

</div>

Years ago I wrote programs kinds95.f90 which does nothing beyond Fortran 95 except reading ‘INF’ as real if a compiler allows that, and kinds03.f90 in Fortran 2003 dialect. They print useful properties of all the real and integer kinds known to a compiler (huge,precision,tiny,radix and many more). They are publicly available in  
`https://homepages.ecs.vuw.ac.nz/~harper/kinds95.f90` and  
`https://homepages.ecs.vuw.ac.nz/~harper/kinds03.f90`

I have recently updated them by testing whether `exponent(inf)==huge(1)`, where `inf` is either an IEEE value (kinds03.f90 only) or the result of reading ‘INF’ into a real variable (both programs), because that is a more severe test than just printing the value of `inf`.

The programs compile, run and print correct results with gfortran, ifx and ifort in a Linux system. They compile, run and reveal problems with g95 and AMD flang. Lfortran 0.41.0 can’t compile them. I don’t know what happens in non-Linux systems or other compilers.

---

<div class="post-metadata">

**Author:** ![Arjen](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Arjen](https://fortran-lang.discourse.group/u/Arjen)\
**Post date:** [November 10, 2024, 10:37am UTC](https://fortran-lang.discourse.group/t/finding-properties-of-numeric-kinds/8814/2 "2024-11-10T10:37:15Z")

</div>

I ran the two programs on WIndows 11, using both gfortran and ifx. Some curious differences could be seen: gfortran supports an extended real kind and an 16-bytes integer, which ifx does not. Ther are other subtler differences as well.
