Skip to content

Commit

Permalink
bitwise 'Name' method in docs returns correct name (#319)
Browse files Browse the repository at this point in the history
* bitwise 'Name' method in docs returns correct name

* typo in `BITWISE_INPUT_CELLS_PER_INSTANCE`

* BIWISE->BITWISE

* const BIWISE->BITWISE fix

* fix for `InputCellsPerInstance` method
  • Loading branch information
jobez authored Nov 2, 2023
1 parent f08fbfd commit e01d7a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,7 @@ func (b *BitwiseBuiltinRunner) Base() memory.Relocatable {
}
func (b *BitwiseBuiltinRunner) Name() string {
return "range_check"
return "bitwise"
}
```
Expand Down Expand Up @@ -2913,7 +2913,7 @@ const BIWISE_INPUT_CELLS_PER_INSTANCE = 2
func (b *BitwiseBuiltinRunner) DeduceMemoryCell(address memory.Relocatable, mem *memory.Memory) (*memory.MaybeRelocatable, error) {
index := address.Offset % BITWISE_CELLS_PER_INSTANCE
if index < BIWISE_INPUT_CELLS_PER_INSTANCE {
if index < BITWISE_INPUT_CELLS_PER_INSTANCE {
return nil, nil
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/builtins/bitwise.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const BITWISE_BUILTIN_NAME = "bitwise"
const BITWISE_CELLS_PER_INSTANCE = 5
const BITWISE_TOTAL_N_BITS = 251
const BIWISE_INPUT_CELLS_PER_INSTANCE = 2
const BITWISE_INPUT_CELLS_PER_INSTANCE = 2

type BitwiseBuiltinRunner struct {
base memory.Relocatable
Expand Down Expand Up @@ -60,7 +60,7 @@ func (b *BitwiseBuiltinRunner) InitialStack() []memory.MaybeRelocatable {

func (b *BitwiseBuiltinRunner) DeduceMemoryCell(address memory.Relocatable, mem *memory.Memory) (*memory.MaybeRelocatable, error) {
index := address.Offset % BITWISE_CELLS_PER_INSTANCE
if index < BIWISE_INPUT_CELLS_PER_INSTANCE {
if index < BITWISE_INPUT_CELLS_PER_INSTANCE {
return nil, nil
}

Expand Down Expand Up @@ -112,7 +112,7 @@ func (b *BitwiseBuiltinRunner) CellsPerInstance() uint {
}

func (b *BitwiseBuiltinRunner) InputCellsPerInstance() uint {
return BIWISE_INPUT_CELLS_PER_INSTANCE
return BITWISE_INPUT_CELLS_PER_INSTANCE
}

func (b *BitwiseBuiltinRunner) GetAllocatedMemoryUnits(segments *memory.MemorySegmentManager, currentStep uint) (uint, error) {
Expand Down

0 comments on commit e01d7a5

Please sign in to comment.