Problem 1646

Summary: Integer overflow in FactorialFactor
Product: Geant4 Reporter: Vittorio Zecca <vitti570>
Component: processes/hadronic/models/pre_equilibriumAssignee: Vladimir.Ivantchenko
Status: RESOLVED FIXED    
Severity: normal CC: Alberto.Ribon
Priority: P5    
Version: 10.0   
Hardware: PC   
OS: Linux   

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