Skip to content

Commit

Permalink
Update rainflow.c
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ma72 authored Jul 25, 2024
1 parent 4775de5 commit 80fde7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/rainflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 80fde7c

Please sign in to comment.