diff --git a/src/lib/rainflow.c b/src/lib/rainflow.c index efa775f..78c564d 100644 --- a/src/lib/rainflow.c +++ b/src/lib/rainflow.c @@ -5268,8 +5268,8 @@ bool damage_calc( rfc_ctx_s *rfc_ctx, unsigned class_from, unsigned class_to, do return false; } #else /*!RFC_MINIMAL*/ - double Sa_i = fabs( (int)class_from - (int)class_to ) / 2.0 * rfc_ctx->class_width; - double Sm_i = ( (int)class_from + (int)class_to ) / 2.0 * rfc_ctx->class_width + rfc_ctx->class_offset; + double Sa_i = (double)abs( (int)class_from - (int)class_to ) / 2.0 * rfc_ctx->class_width; + double Sm_i = ( (int)class_from + (int)class_to ) / 2.0 * rfc_ctx->class_width + rfc_ctx->class_offset; if( Sa_i > 0.0 ) { @@ -5831,8 +5831,8 @@ void cycle_find_astm( rfc_ctx_s *rfc_ctx, rfc_flags_e flags ) unsigned A = rfc_ctx->residue[idx+0].cls; unsigned B = rfc_ctx->residue[idx+1].cls; unsigned C = rfc_ctx->residue[idx+2].cls; - unsigned Y = abs( A - B ); - unsigned X = abs( B - C ); + unsigned Y = abs( (int)A - (int)B ); + unsigned X = abs( (int)B - (int)C ); /* Check for closed cycles [1] */ if( X >= Y )