Problem 1646 - Integer overflow in FactorialFactor
Summary: Integer overflow in FactorialFactor
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models/pre_equilibrium (show other problems)
Version: 10.0
Hardware: PC Linux
: P5 normal
Assignee: Vladimir.Ivantchenko
URL:
Depends on:
Blocks:
 
Reported: 2014-06-24 07:51 CEST by Vittorio Zecca
Modified: 2014-07-04 20:17 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Vittorio Zecca 2014-06-24 07:51:10 CEST
Running RE02 run1.mac, and others, I get an integer overflow in function FactorialFactor at G4PreCompoundAlhpa.cc:64
"return G4double((N-4)*(P-3)*(N-3)*(P-2)*(N-2)*(P-1)*(N-1)*P)/12.0;"
because the partial factors are computed with G4int precision (32 bits on my PC).
I believe these partial factors should be computed as G4double.
All the similar FactorialFactor functions in geant4 should be fixed.
Comment 1 Vladimir.Ivantchenko 2014-07-01 12:21:56 CEST
Hello,

thanks for pointing to the bug. The problem is clear and the fix will be provided in the next patches for 9.6 and 10.0 releases.

VI
Comment 2 Vladimir.Ivantchenko 2014-07-04 20:16:24 CEST
Hello,

The problem is reproduced and the fix is submitted. It will be available with the new public patch.

VI