FC18: Keep rational strobe arguments in the network order
This commit is contained in:
parent
7559789824
commit
33794a8186
5 changed files with 15 additions and 15 deletions
|
|
@ -324,7 +324,7 @@ public class FourCornerUnicodeDisplay {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, BigInteger numerator, BigInteger denominator) {
|
||||
public void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, BigInteger numerator, FCFlameNumberTaste tasteFemale, BigInteger denominator) {
|
||||
// TODO: write full format for all new numbers in short FC6 encoding like; (ratio and choco int's)
|
||||
// auto ratio = 0R.0TrD-123.-123; // = 0rX12FF.12FF = 0tNAN = 0tD123.456 (use pure upper case FC6 AND also have FC6PLus version)
|
||||
if (tasteMale.statusSignNegative()) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit {
|
|||
void strobeNumberGrams(FCFlameNumberGram gram, List<Integer> values);
|
||||
|
||||
/// Embed choco married pig rational number. (4+2300+4+2300)
|
||||
void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale, BigInteger numerator, BigInteger denominator);
|
||||
void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, BigInteger numerator, FCFlameNumberTaste tasteFemale, BigInteger denominator);
|
||||
|
||||
/// Embed choco pig decimal number. (4+1+283+2016)
|
||||
void strobeNumberChocoPigDecimal(FCFlameNumberTaste taste, boolean bias, BigInteger power, BigInteger coefficient);
|
||||
|
|
@ -62,8 +62,8 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit {
|
|||
}
|
||||
|
||||
@Override
|
||||
default void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale,
|
||||
BigInteger numerator, BigInteger denominator) {
|
||||
default void strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste tasteMale, BigInteger numerator,
|
||||
FCFlameNumberTaste tasteFemale, BigInteger denominator) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -378,8 +378,8 @@ public class FourCornerZionStenoGrapher {
|
|||
|
||||
@Override
|
||||
public void strobeNumberChocoMarriedPigsRational(
|
||||
FCFlameNumberTaste tasteMale, FCFlameNumberTaste tasteFemale,
|
||||
BigInteger numerator, BigInteger denominator
|
||||
FCFlameNumberTaste tasteMale, BigInteger numerator,
|
||||
FCFlameNumberTaste tasteFemale, BigInteger denominator
|
||||
) {
|
||||
Objects.requireNonNull(tasteMale);
|
||||
Objects.requireNonNull(tasteFemale);
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
|||
BigInteger marriedPigs = lexer.numberBankReadBig12(numberBankTop);
|
||||
BigInteger numerator = marriedPigs.shiftRight(2304);
|
||||
BigInteger denominator = marriedPigs.and(BIG_BITS_2304);
|
||||
lexer.handler.strobeNumberChocoMarriedPigsRational(tasteMale, tasteFemale, numerator, denominator);
|
||||
lexer.handler.strobeNumberChocoMarriedPigsRational(tasteMale, numerator, tasteFemale, denominator);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,11 +160,11 @@ public class StenoGrapherTest {
|
|||
List<Integer> outX18 = new ArrayList<>();
|
||||
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
|
||||
BigInteger v1 = BigInteger.valueOf(123);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v1);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v1);
|
||||
BigInteger v2 = BigInteger.valueOf(12345);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v2);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v2);
|
||||
BigInteger v3 = BigInteger.valueOf(5432);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_NEGATIVE, FCFlameNumberTaste.NUMBER_NEGATIVE, v3, v3);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_NEGATIVE, v3, FCFlameNumberTaste.NUMBER_NEGATIVE, v3);
|
||||
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
|
||||
Assertions.assertEquals("¹/₁₂₃¹/₁₂₃₄₅⁻⁵⁴³²/₋₅₄₃₂", resX18);
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ public class StenoGrapherTest {
|
|||
writerX18.strobeDocumentAlpha();
|
||||
for (int x = 1; x <= 1025 /*_999999*/; x++) {
|
||||
BigInteger v = BigInteger.valueOf(x);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v);
|
||||
writerX18.strobeTheWord(FCDotF4TTY0001DashNL.NETHER_LINE.cakePointDotIndex());
|
||||
}
|
||||
writerX18.strobeDocumentOmega();
|
||||
|
|
@ -204,7 +204,7 @@ public class StenoGrapherTest {
|
|||
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
|
||||
for (int x = 1; x <= 1025; x++) {
|
||||
BigInteger v = BigInteger.valueOf(x);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, v);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, BigInteger.ONE, FCFlameNumberTaste.NUMBER_POSITIVE, v);
|
||||
}
|
||||
String resX18 = FourCornerUnicodeDisplay.text().renderFromInt18(outX18);
|
||||
Assertions.assertTrue(resX18.startsWith("¹/₁¹/₂¹/₃"), "missing " + resX18);
|
||||
|
|
@ -217,12 +217,12 @@ public class StenoGrapherTest {
|
|||
List<Integer> outX18 = new ArrayList<>();
|
||||
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
|
||||
BigInteger maxValue = FourCornerZionStenoPetroglyphs.BIG_BITS_2300;
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, maxValue);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue);
|
||||
Assertions.assertThrows(IllegalArgumentException.class, () -> {
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, maxValue.add(BigInteger.ONE));
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, maxValue, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue.add(BigInteger.ONE));
|
||||
});
|
||||
Assertions.assertThrows(IllegalArgumentException.class, () -> {
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, FCFlameNumberTaste.NUMBER_POSITIVE, maxValue.add(BigInteger.ONE), maxValue);
|
||||
writerX18.strobeNumberChocoMarriedPigsRational(FCFlameNumberTaste.NUMBER_POSITIVE, maxValue.add(BigInteger.ONE), FCFlameNumberTaste.NUMBER_POSITIVE, maxValue);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue