File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
include/boost/math/distributions Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ namespace boost { namespace math {
147
147
return result;
148
148
}
149
149
150
- RealType power = (x - location) / scale;
150
+ using promoted_real_type = typename policies::evaluation<RealType, Policy>::type;
151
+ promoted_real_type power = (static_cast <promoted_real_type>(x) - static_cast <promoted_real_type>(location)) / static_cast <promoted_real_type>(scale);
151
152
return logistic_sigmoid (power, Policy ());
152
153
}
153
154
@@ -248,7 +249,9 @@ namespace boost { namespace math {
248
249
{
249
250
return result;
250
251
}
251
- RealType power = (location - x) / scale;
252
+
253
+ using promoted_real_type = typename policies::evaluation<RealType, Policy>::type;
254
+ promoted_real_type power = (static_cast <promoted_real_type>(location) - static_cast <promoted_real_type>(x)) / static_cast <promoted_real_type>(scale);
252
255
return logistic_sigmoid (power, Policy ());
253
256
}
254
257
You can’t perform that action at this time.
0 commit comments