2022-01-30 21:00:16 +00:00
|
|
|
package love.distributedrebirth.numberxd;
|
2022-01-28 10:24:54 +00:00
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2022-01-30 21:00:16 +00:00
|
|
|
import love.distributedrebirth.numberxd.base2t.BaseNumberTyte;
|
|
|
|
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
|
|
|
|
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
|
|
|
|
import love.distributedrebirth.numberxd.base2t.V009Tyte;
|
|
|
|
import love.distributedrebirth.numberxd.base2t.V009TyteBaseAppender;
|
|
|
|
import love.distributedrebirth.numberxd.base2t.V009TyteBaseIterator;
|
|
|
|
import love.distributedrebirth.numberxd.base2t.V090Tocta;
|
2022-01-28 10:24:54 +00:00
|
|
|
|
2022-01-29 04:50:02 +00:00
|
|
|
/**
|
2022-01-30 20:50:19 +00:00
|
|
|
* Holds an 144 bit fraction.
|
2022-01-29 04:50:02 +00:00
|
|
|
*
|
|
|
|
* @author willemtsade ©Δ∞ 仙上主天
|
|
|
|
*
|
|
|
|
*/
|
2022-01-30 20:50:19 +00:00
|
|
|
public class GroßGetậl1D implements BaseNumberTyte<GroßGetậl1D> {
|
2022-01-28 10:24:54 +00:00
|
|
|
|
|
|
|
public static int NUMERATOR_SIZE = 7;
|
|
|
|
public static int DENOMINATOR_SIZE = 9;
|
2022-01-30 20:50:19 +00:00
|
|
|
public static int BIT_COUNT = V090Tocta.BIT_COUNT;
|
2022-01-28 10:24:54 +00:00
|
|
|
private final V009Tyte[] numerator = new V009Tyte[NUMERATOR_SIZE];
|
|
|
|
private final V009Tyte[] denominator = new V009Tyte[DENOMINATOR_SIZE];
|
|
|
|
|
2022-01-30 20:50:19 +00:00
|
|
|
public GroßGetậl1D() {
|
2022-01-28 10:24:54 +00:00
|
|
|
for (int i=0;i<NUMERATOR_SIZE;i++) {
|
|
|
|
numerator[i] = new V009Tyte();
|
|
|
|
}
|
|
|
|
for (int i=0;i<DENOMINATOR_SIZE;i++) {
|
|
|
|
denominator[i] = new V009Tyte();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-30 20:50:19 +00:00
|
|
|
public GroßGetậl1D(T08PartOctalBaseIterator values) {
|
2022-01-30 10:28:52 +00:00
|
|
|
for (int i=0;i<NUMERATOR_SIZE;i++) {
|
|
|
|
numerator[i] = new V009Tyte(values);
|
|
|
|
}
|
|
|
|
for (int i=0;i<DENOMINATOR_SIZE;i++) {
|
|
|
|
denominator[i] = new V009Tyte(values);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-30 20:50:19 +00:00
|
|
|
public GroßGetậl1D(V009TyteBaseIterator values) {
|
2022-01-30 10:28:52 +00:00
|
|
|
for (int i=0;i<NUMERATOR_SIZE;i++) {
|
|
|
|
numerator[i] = values.next();
|
|
|
|
}
|
|
|
|
for (int i=0;i<DENOMINATOR_SIZE;i++) {
|
|
|
|
denominator[i] = values.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-30 20:50:19 +00:00
|
|
|
public GroßGetậl1D(V090Tocta tocta) {
|
2022-01-28 10:24:54 +00:00
|
|
|
List<V009Tyte> tytes = new ArrayList<>();
|
2022-01-31 12:15:04 +00:00
|
|
|
tocta.fillTytesByReference(new V009TyteBaseAppender(tytes));
|
2022-01-28 10:24:54 +00:00
|
|
|
for (int i=0;i<NUMERATOR_SIZE;i++) {
|
|
|
|
numerator[i] = tytes.get(i);
|
|
|
|
}
|
|
|
|
for (int i=0;i<DENOMINATOR_SIZE;i++) {
|
|
|
|
denominator[i] = tytes.get(i+NUMERATOR_SIZE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-31 12:15:04 +00:00
|
|
|
public V090Tocta toToctaByReference() {
|
|
|
|
return new V090Tocta(iteratorTytesByReference());
|
|
|
|
}
|
|
|
|
|
|
|
|
public V090Tocta toToctaByClone() {
|
|
|
|
return new V090Tocta(iteratorOctalsByClone());
|
2022-01-30 10:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getBitCount() {
|
2022-01-30 14:27:57 +00:00
|
|
|
return V090Tocta.BIT_COUNT;
|
2022-01-30 10:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-01-30 20:50:19 +00:00
|
|
|
public GroßGetậl1D toClone() {
|
2022-01-31 12:15:04 +00:00
|
|
|
return new GroßGetậl1D(iteratorOctalsByClone());
|
2022-01-30 10:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-01-31 12:15:04 +00:00
|
|
|
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
|
2022-01-30 10:28:52 +00:00
|
|
|
for (int i=0;i<NUMERATOR_SIZE;i++) {
|
2022-01-31 12:15:04 +00:00
|
|
|
numerator[i].fillOctalsByClone(appender);
|
2022-01-30 10:28:52 +00:00
|
|
|
}
|
|
|
|
for (int i=0;i<DENOMINATOR_SIZE;i++) {
|
2022-01-31 12:15:04 +00:00
|
|
|
denominator[i].fillOctalsByClone(appender);
|
2022-01-30 10:28:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-01-31 12:15:04 +00:00
|
|
|
public void fillTytesByReference(V009TyteBaseAppender appender) {
|
2022-01-28 10:24:54 +00:00
|
|
|
for (int i=0;i<NUMERATOR_SIZE;i++) {
|
2022-01-30 10:28:52 +00:00
|
|
|
appender.add(numerator[i]);
|
2022-01-28 10:24:54 +00:00
|
|
|
}
|
|
|
|
for (int i=0;i<DENOMINATOR_SIZE;i++) {
|
2022-01-30 10:28:52 +00:00
|
|
|
appender.add(denominator[i]);
|
2022-01-28 10:24:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|