# Changelog

Notes significant changes to `i256`.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.2] 2025-01-16

## Added

- Optional support for `num-traits`, implementing that crate's integer arithmetic and conversion traits for all provided integer types (@pthariensflame, #71)

## [0.2.1] 2025-01-05

## Changed

- Improved documentation for what functionality is available with what features (@loyd, #70).

## [0.2.0] 2025-01-01

## Added

- `*_u32`, `*_u64`, and `*_u128` methods for direct API interactions with fixed with integral types, at the potential cost of performance on some architectures.

## Changed

- Move `I384`, etc. under the `i384`, `i512`, and `i1024` features.
- Added many `#[must_use]` attributes for expensive operations which create copies of values.

## Fixed

- Restored the `*_uwide` and `*_iwide` API methods.
- Support for 32-bit limbs.
- Improved performance for certain operations.

## [0.1.2] 2024-12-30

## Added

- Added the `const` comparison functions for the full `Ord` API.
- Added `to_str_radix`.
- Add support for 32-bit limbs.
- `most_significant_limb` and `least_significant_limb` methods.
- Added `widening_mul` and `carrying_mul` methods.

## Fixed

- Behavior for `overflowing_div` and similar division methods when dividing by zero to properly panic.
- Overflow checks for `shr` and `shl` implementations.
- Fixed the padding and formatting for `Octal`, `UpperHex`, `LowerHex` and `Binary`.
- Division by an unsigned factor from a signed big integer, to correctly adjust the quotient and remainder for floor division.
- Optimize unsigned, checked multiplication by looking for immediate overflow.

## Changed

- Made the internal implementation size-generic, mostly, so we can use higher order types for our precomputed division.
- Improved addition and subtraction performance.
- Implemented multiplication in big-endian order, without any byte order changes, on big-endian systems.

## Removed

- The `shr_const_*` and `shl_const_*` methods, since `wrapping_shr` should cover every use-case.
- Our entire wide API, and replaced only with limb.
- The casts `as_i256`, `as_u256`, `from_i256`, and `from_u256`, since these don't generalize to higher order types.
- The `new()`, `high()`, and `low()` methods, since these generalize poorer to larger type sizes and the `from_*e_u64` and similar methods provide a complete replacement.

## [0.1.1] 2024-12-24

## Fixed

- Crate description and repisitory link on crates.io (#37, @pthariensflame).

## [0.1.0] 2024-12-24

## Added

- Complete API matching the core, primitive integral types.
- Optimizations for most mathematical operations.
