Skip to content

Commit

Permalink
Merge pull request #277 from tomhea/hotfix/small-improvements
Browse files Browse the repository at this point in the history
hex.add_constant support const==0
  • Loading branch information
tomhea authored Dec 8, 2024
2 parents aaeb6ff + 48cc831 commit 2cf943f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flipjump/stl/hex/math.fj
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ ns hex {
// dst[:dst_n] += const
// @requires hex.add.init (or hex.init)
// n_const is the hex-length of const, without all of it's least-significant-hexes zeros.
def add_constant n, dst, const {
def add_constant n, dst, const @ end {
stl.comp_if0 const, end
.add.add_constant_with_leading_zeros n, dst, const, (#(const&(0-const)))-1
end:
}
ns add {
def add_constant_with_leading_zeros n, dst, const, leading_lsb_const_zeros {
Expand Down

0 comments on commit 2cf943f

Please sign in to comment.