{"id":41841047,"url":"https://github.com/equipez/infnan","last_synced_at":"2026-01-25T09:22:14.372Z","repository":{"id":65449442,"uuid":"407007167","full_name":"equipez/infnan","owner":"equipez","description":"Fortran functions for checking Inf/NaN. They should work even if the compilers are invoked with aggressive optimization flags such as `gfortran -Ofast`. ","archived":false,"fork":false,"pushed_at":"2024-06-14T07:56:06.000Z","size":477,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T21:55:28.257Z","etag":null,"topics":["floating-point","fortran","inf","nan","numerical"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/equipez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-16T03:34:28.000Z","updated_at":"2025-03-05T10:26:57.000Z","dependencies_parsed_at":"2023-02-13T10:20:18.563Z","dependency_job_id":"7d02dfe2-29bd-496e-8ae9-6f806c94ad01","html_url":"https://github.com/equipez/infnan","commit_stats":{"total_commits":190,"total_committers":2,"mean_commits":95.0,"dds":"0.13157894736842102","last_synced_commit":"5577999f0cd05ec96b331af70bb642ee4d869fca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/equipez/infnan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equipez%2Finfnan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equipez%2Finfnan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equipez%2Finfnan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equipez%2Finfnan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/equipez","download_url":"https://codeload.github.com/equipez/infnan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equipez%2Finfnan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28750872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T09:00:19.176Z","status":"ssl_error","status_checked_at":"2026-01-25T09:00:04.131Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["floating-point","fortran","inf","nan","numerical"],"created_at":"2026-01-25T09:22:14.306Z","updated_at":"2026-01-25T09:22:14.366Z","avatar_url":"https://github.com/equipez.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# infnan\n\n`infnan.f90` implements a module that provides some functions for checking Inf/NaN. They aim to work\neven when compilers are invoked with aggressive optimization flags, including particularly `gfortran -Ofast`.\n\nMany ways exist to implement functions like `is_nan`. However, not all of them work with\naggressive optimization flags. For example, there are such discussions on\n[StackOverflow](https://stackoverflow.com/questions/15944614) and [Fotran Discourse](https://fortran-lang.discourse.group/t/checking-inf-nan-when-compilers-are-invoked-with-aggressive-optimization-flags/1851).\n\nThe `ieee_is_nan` included in `ieee_arithmetic` of `gfortran 9.3.0` does not work with aggressive\noptimization flags like `-Ofast`.\nGiven the fact that `-Ofast` implies `-ffinite-math-only`, we cannot blame `ieee_arithmetic` for\nthe failure. In addition, some compilers\n(`gfortran 9.3.0`, `ifort 21.0`, and `nagfor 7.0`) may not behave in the most desirable way concerning\nthe return kind of `ieee_is_nan` when some special compilation flags are imposed, as has been discussed\non [Fortran Discourse](https://fortran-lang.discourse.group/t/is-this-expected-fortran-standard-is-not-respected-by-gfortran-fdefault-integer-8-ifort-i8-or-nagfor-i8).\n\nMy choice of implementation is totally empirical, in the sense that I have not studied in-depth what\nthe aggressive optimization flags really do, but only made some tests and found some implementation\nthat worked correctly. In other words, I do not know why my implementation works but other\nimplementations may not. The story may change when compilers are changed/updated.\n\nThe good news is, I have tested the functions using ten compilers with the most \naggressive optimization flags that I can figure out, and they all succeeded. In particular, the functions work well with `gfortran -Ofast` for `gfortran` 9.3.0 and 10.3.0, \nbut those based on `ieee_arithmetic` fail. Such a test can be done by\n\n```\ncd test \u0026\u0026 make clean \u0026\u0026 make gtest\n```\n\nHowever, we did observe failures. \nSee the [issues](https://github.com/zaikun/infnan/issues) for details. I will be very happy to hear your suggestions on how to fix them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequipez%2Finfnan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fequipez%2Finfnan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequipez%2Finfnan/lists"}