Skip to content

Floating point exception, which may lead to bugs #6355

@A-006

Description

@A-006

Describe the bug

when i run the abacus in sunway, i find many Floating point exception.
1.
Error in the division by zero,the array atom->ncpp.r may have zero,thus the r2 may zero,it is a undefined behavior
Image
2. the Non-standard number
If the value of cell.atoms[it].ncpp.betar is less than 1e-308, it is directly set to 0 on Intel, but on Sunway, for some reason, it appears as a non-normalized integer, which prevents any calculations from being performed.Actullay if a double value less than 1e-300,it can be set as zero to avoid the problem in other meachine.

Image
3.
the array rho_basis->gg may have zero,thus there is an error in the division by zero ,it is a undefined behavior.
Image

Expected behavior

No response

To Reproduce

No response

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Metadata

Metadata

Assignees

Labels

BugsBugs that only solvable with sufficient knowledge of DFT

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions