diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/BaseGetậl.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/BaseGetậl.java index 6eb4cbf9..bf221184 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/BaseGetậl.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/BaseGetậl.java @@ -1,6 +1,7 @@ package love.distributedrebirth.numberxd; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.numberxd.base2t.BaseIteratorOctal; import love.distributedrebirth.numberxd.base2t.BaseNumber; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @@ -8,5 +9,7 @@ public interface BaseGetậl,V extends BaseNumber> V getValue(); - T toClone(); + T toClone(BaseIteratorOctal values); + + BaseIteratorOctal iteratorOctalsByClone(); } diff --git a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl1ⁿᴰ.java b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl1ⁿᴰ.java index b6e046b7..8ce7a245 100644 --- a/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl1ⁿᴰ.java +++ b/demo4d-numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl1ⁿᴰ.java @@ -47,7 +47,12 @@ public class GroßGetậl1ⁿᴰ extends AbstractBaseGetậlMatrix1,V extends BaseNumber> BaseGetậl math(BaseGetậl opA, BaseGetậl opB) { + BaseIteratorOctal bioA = opA.iteratorOctalsByClone(); + BaseIteratorOctal bioB = opB.iteratorOctalsByClone(); + BaseIteratorOctalALU bioALU = new BaseIteratorOctalALU(bioA, bioB); + BaseGetậl result = opA.toClone(bioALU); + return result; + } + + class BaseIteratorOctalALU implements BaseIteratorOctal { + + private final BaseIteratorOctal bioA; + private final BaseIteratorOctal bioB; + + public BaseIteratorOctalALU(BaseIteratorOctal bioA, BaseIteratorOctal bioB) { + this.bioA = bioA; + this.bioB = bioB; + } + + @Override + public boolean hasNext() { + return bioA.hasNext(); + } + + @Override + public T08PartOctal next() { + T08PartOctal valA = bioA.next(); + T08PartOctal valB = bioB.next(); + + int valANum = valA.BȍőnRangTelNul(); + int valBNum = valB.BȍőnRangTelNul(); + + var valResultNum = valANum + valBNum; + + if (valResultNum > valA.BãßInstances().length) { + valResultNum = valA.BãßInstances().length -1; + } + + T08PartOctal valResult = T08PartOctal.values()[valResultNum]; + + return valResult; + } + } }