Skip to content

Commit

Permalink
chore: a bit of proofreading (#267)
Browse files Browse the repository at this point in the history
## Proofreading

<!-- Please try to limit your pull request to one type; submit multiple
pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [X] Documentation content changes
- [ ] Other (please describe):




## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!-- If this does introduce a breaking change, please describe the
impact and migration path for existing applications below. -->

## Other information

Found a few errors, one is in the README file, rest are in comments
  • Loading branch information
Frierened authored Jan 26, 2024
1 parent 99a989c commit 8ddf024
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/data_structures/src/bit_array.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ trait BitArrayTrait {
fn read_word_be_u512(ref self: BitArray, length: usize) -> Option<u512>;
/// Writes the bits of the specified length from `word` onto the BitArray
/// in big endian representation
/// # Arguemnts
/// # Arguments
/// `word` - The value to store onto the bit array of type `felt252`
/// `length` - The length of the word in bits, maximum 248
fn write_word_be(ref self: BitArray, word: felt252, length: usize);
/// Writes the bits of the specified length from `word` onto the BitArray
/// in big endian representation
/// # Arguemnts
/// # Arguments
/// `word` - The value to store onto the bit array of type `u256`
/// `length` - The length of the word in bits, maximum 256
fn write_word_be_u256(ref self: BitArray, word: u256, length: usize);
/// Writes the bits of the specified length from `word` onto the BitArray
/// in big endian representation
/// # Arguemnts
/// # Arguments
/// `word` - The value to store onto the bit array of type `u512`
/// `length` - The length of the word in bits, maximum 512
fn write_word_be_u512(ref self: BitArray, word: u512, length: usize);
Expand All @@ -102,19 +102,19 @@ trait BitArrayTrait {
fn read_word_le_u512(ref self: BitArray, length: usize) -> Option<u512>;
/// Writes the bits of the specified length from `word` onto the BitArray
/// in little endian representation
/// # Arguemnts
/// # Arguments
/// `word` - The value to store onto the bit array of type `felt252`
/// `length` - The length of the word in bits, maximum 248
fn write_word_le(ref self: BitArray, word: felt252, length: usize);
/// Writes the bits of the specified length from `word` onto the BitArray
/// in little endian representation
/// # Arguemnts
/// # Arguments
/// `word` - The value to store onto the bit array of type `u256`
/// `length` - The length of the word in bits, maximum 256
fn write_word_le_u256(ref self: BitArray, word: u256, length: usize);
/// Writes the bits of the specified length from `word` onto the BitArray
/// in little endian representation
/// # Arguemnts
/// # Arguments
/// `word` - The value to store onto the bit array of type `u512`
/// `length` - The length of the word in bits, maximum 512
fn write_word_le_u512(ref self: BitArray, word: u512, length: usize);
Expand Down
2 changes: 1 addition & 1 deletion src/data_structures/src/byte_reader.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait ByteReader<T> {
/// # Returns
/// * `ByteReader` - The reader struct wrapping a read-only snapshot of this ByteArray
fn reader(self: @T) -> ByteReaderState<T>;
/// Checks that there are enoguh remaining bytes available
/// Checks that there are enough remaining bytes available
/// # Arguments
/// * `at` - the start index position of the byte data
/// * `count` - the number of bytes required
Expand Down
2 changes: 1 addition & 1 deletion src/math/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `is_power_of_two` algorithm is used to determine whether a given positive in

The trigonometric functions are a set of mathematical functions that relate the angles of a triangle to the lengths of its sides. The most common trigonometric functions are sine, cosine, and tangent. These functions are used in many areas of mathematics, including geometry, calculus, and statistics. They are also used in physics, engineering, and other sciences.

Fast trigonometric functions are computational and spacial efficient, with minor errors compared to the standard trigonometric functions. Refer to http://hevi.info/tag/fast-sine-function/ for detailed information.
Fast trigonometric functions are computational and spatial efficient, with minor errors compared to the standard trigonometric functions. Refer to http://hevi.info/tag/fast-sine-function/ for detailed information.

## [Is Prime](./src/is_prime.cairo)

Expand Down
2 changes: 1 addition & 1 deletion src/math/src/karatsuba.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn div_half_ceil(num: u128) -> u128 {

/// Helper function for 'multiply',splits a number at the indicated index and returns it in a tuple.
/// # Arguments
/// * `num` - The current value to be splited.
/// * `num` - The current value to be split.
/// * `split_idx` - Index at which the number will be split
/// # Returns
/// * `(u128, u128)` -tuple representing the split number.
Expand Down
8 changes: 4 additions & 4 deletions src/math/src/mod_arithmetics.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ fn add_inverse_mod(b: u256, modulo: u256) -> u256 {
modulo - b
}

/// Function that performs modular substraction.
/// Function that performs modular subtraction.
/// # Arguments
/// * `a` - Left hand side of substraction.
/// * `b` - Right hand side of substraction.
/// * `a` - Left hand side of subtraction.
/// * `b` - Right hand side of subtraction.
/// * `modulo` - modulo.
/// # Returns
/// * `u256` - result of modular substraction
/// * `u256` - result of modular subtraction
#[inline(always)]
fn sub_mod(mut a: u256, mut b: u256, modulo: u256) -> u256 {
// reduce values
Expand Down

0 comments on commit 8ddf024

Please sign in to comment.