Skip to content

Commit

Permalink
Fix typo in code comments ("iff")
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed Apr 26, 2024
1 parent ea29af0 commit 6d43e17
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/fasterxml/jackson/core/Base64Variant.java
Expand Up @@ -725,7 +725,7 @@ public void decode(String str, ByteArrayBuilder builder) throws IllegalArgumentE
decodedData = (decodedData << 6) | bits;
// third base64 char; can be padding, but not ws
if (ptr >= len) {
// but as per [JACKSON-631] can be end-of-input, iff padding is not required
// but as per [JACKSON-631] can be end-of-input, if padding is not required
if (!requiresPaddingOnRead()) {
decodedData >>= 4;
builder.append(decodedData);
Expand Down Expand Up @@ -761,7 +761,7 @@ public void decode(String str, ByteArrayBuilder builder) throws IllegalArgumentE
decodedData = (decodedData << 6) | bits;
// fourth and last base64 char; can be padding, but not ws
if (ptr >= len) {
// but as per [JACKSON-631] can be end-of-input, iff padding on read is not required
// but as per [JACKSON-631] can be end-of-input, if padding on read is not required
if (!requiresPaddingOnRead()) {
decodedData >>= 2;
builder.appendTwoBytes(decodedData);
Expand Down
Expand Up @@ -945,7 +945,7 @@ public void writeTypeId(Object id) throws IOException {
/**********************************************************
*/

// Base class definitions for these seems correct to me, iff not directly delegating:
// Base class definitions for these seems correct to me, if not directly delegating:

/*
@Override
Expand Down Expand Up @@ -990,7 +990,7 @@ public void writeTree(TreeNode rootNode) throws IOException {
/**********************************************************
*/

// Base class definitions for these seems correct to me, iff not directly delegating:
// Base class definitions for these seems correct to me, if not directly delegating:

/*
@Override
Expand Down
Expand Up @@ -253,11 +253,11 @@ private String toDecimalString(double v) {

/*
Returns
PLUS_ZERO iff v is 0.0
MINUS_ZERO iff v is -0.0
PLUS_INF iff v is POSITIVE_INFINITY
MINUS_INF iff v is NEGATIVE_INFINITY
NAN iff v is NaN
PLUS_ZERO if v is 0.0
MINUS_ZERO if v is -0.0
PLUS_INF if v is POSITIVE_INFINITY
MINUS_INF if v is NEGATIVE_INFINITY
NAN if v is NaN
*/
private int toDecimal(double v) {
/*
Expand Down Expand Up @@ -360,8 +360,8 @@ private int toDecimal(int q, long c, int dk) {
sp10 = 10 s'
tp10 = 10 t'
upin iff u' = sp10 10^k in Rv
wpin iff w' = tp10 10^k in Rv
upin if u' = sp10 10^k in Rv
wpin if w' = tp10 10^k in Rv
See section 9.4 of [1].
*/
long sp10 = 10 * multiplyHigh(s, 115_292_150_460_684_698L << 4);
Expand All @@ -375,8 +375,8 @@ private int toDecimal(int q, long c, int dk) {

/*
10 <= s < 100 or s >= 100 and u', w' not in Rv
uin iff u = s 10^k in Rv
win iff w = t 10^k in Rv
uin if u = s 10^k in Rv
win if w = t 10^k in Rv
See section 9.4 of [1].
*/
long t = s + 1;
Expand Down
Expand Up @@ -252,11 +252,11 @@ private String toDecimalString(float v) {

/*
Returns
PLUS_ZERO iff v is 0.0
MINUS_ZERO iff v is -0.0
PLUS_INF iff v is POSITIVE_INFINITY
MINUS_INF iff v is NEGATIVE_INFINITY
NAN iff v is NaN
PLUS_ZERO if v is 0.0
MINUS_ZERO if v is -0.0
PLUS_INF if v is POSITIVE_INFINITY
MINUS_INF if v is NEGATIVE_INFINITY
NAN if v is NaN
*/
private int toDecimal(float v) {
/*
Expand Down Expand Up @@ -358,8 +358,8 @@ private int toDecimal(int q, int c, int dk) {
sp10 = 10 s'
tp10 = 10 t'
upin iff u' = sp10 10^k in Rv
wpin iff w' = tp10 10^k in Rv
upin if u' = sp10 10^k in Rv
wpin if w' = tp10 10^k in Rv
See section 9.4 of [1].
*/
int sp10 = 10 * (int) (s * 1_717_986_919L >>> 34);
Expand All @@ -373,8 +373,8 @@ private int toDecimal(int q, int c, int dk) {

/*
10 <= s < 100 or s >= 100 and u', w' not in Rv
uin iff u = s 10^k in Rv
win iff w = t 10^k in Rv
uin if u = s 10^k in Rv
win if w = t 10^k in Rv
See section 9.4 of [1].
*/
int t = s + 1;
Expand Down
Expand Up @@ -273,7 +273,7 @@ void testFlog10threeQuartersPow2() {
The first equation above is equivalent to
10^k <= 2^e < 10^(k+1)
Equality holds iff e = k = 0.
Equality holds if e = k = 0.
Henceforth, the predicates to check are equivalent to
k = 0, if e = 0
10^k < 2^e < 10^(k+1), otherwise
Expand Down Expand Up @@ -338,7 +338,7 @@ void testFlog10pow2() {
the right inequality shows that k >= 0.
The left inequality means the same as
len2(10^k) <= e
and the right inequality holds iff
and the right inequality holds if
e < len2(10^(k+1))
The original predicate is thus equivalent to
len2(10^k) <= e < len2(10^(k+1))
Expand Down Expand Up @@ -377,7 +377,7 @@ e < len2(10^(k+1))
The first equation above is equivalent to
2^k <= 10^e < 2^(k+1)
Equality holds iff e = 0, implying k = 0.
Equality holds if e = 0, implying k = 0.
Henceforth, the equivalent predicates to check are
k = 0, if e = 0
2^k < 10^e < 2^(k+1), otherwise
Expand Down

0 comments on commit 6d43e17

Please sign in to comment.