1 file changed, +2, -2
ee7f8ccfix(disorder): prevent int overflow for big n
author
Alex (Oleksii) Haponiuk <git@alexh.dev> on 04-05-2026 12:50 UTC+1
committer
Alex (Oleksii) Haponiuk <git@alexh.dev> on 04-05-2026 12:50 UTC+1
parenta52d87f
    @@ -6,7 +6,7 @@
 6 6 /*   By: ohaponiu <marvin@42.fr>                    +#+  +:+       +#+        */
 7 7 /*                                                +#+#+#+#+#+   +#+           */
 8 8 /*   Created: 2026/04/29 16:30:45 by ohaponiu          #+#    #+#             */
 9  -/*   Updated: 2026/05/03 17:23:54 by mleitao          ###   ########.fr       */
   9+/*   Updated: 2026/05/04 12:50:05 by ohaponiu         ###   ########.fr       */
1010 /*                                                                            */
1111 /* ************************************************************************** */
1212 
    @@ -39,5 +39,5 @@ int	disorder(const t_stack *a)
3939 		}
4040 		i++;
4141 	}
42  -	return (mistakes * DISORDER_RANGE / total_pairs);
  42+	return ((long)mistakes * DISORDER_RANGE / total_pairs);
4343 }