Is it possible to make a clamp function shorter than a ternary in JS?Let's create random number...
“I had a flat in the centre of town, but I didn’t like living there, so …”
3.5% Interest Student Loan or use all of my savings on Tuition?
Formatting a table to look nice
When was drinking water recognized as crucial in marathon running?
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
How to mitigate "bandwagon attacking" from players?
Rationale to prefer local variables over instance variables?
Find maximum of the output from reduce
How to get the first element while continue streaming?
Can we carry rice to Japan?
Make me a metasequence
What is the meaning of "notice to quit at once" and "Lotty points”
Caulking a corner instead of taping with joint compound?
Why won't the strings command stop?
Levi-Civita symbol: 3D matrix
Why are special aircraft used for the carriers in the United States Navy?
function only contains jump discontinuity but is not piecewise continuous
Should I use HTTPS on a domain that will only be used for redirection?
Specific Chinese carabiner QA?
An Undercover Army
Split a number into equal parts given the number of parts
What is a term for a function that when called repeatedly, has the same effect as calling once?
Create chunks from an array
Why did the Cray-1 have 8 parity bits per word?
Is it possible to make a clamp function shorter than a ternary in JS?
Let's create random number genratorBase-2 integer logarithm of 64-bit unsigned integerInteger square root of integerTweetable Mathematical ArtShortest Minmod FunctionNon-repeating random numbersCompute the Mertens functionMagic popcount numbersBe as evil as possibleTernary Triangles
$begingroup$
Imagine this short function to clamp a number between 0 and 255:
c = n => n > 0 ? n < 255 ? n : 255 : 0
Is this the shortest possible version of a clamp function with JavaScript (without ES.Next features)?
P.S: Not sure if it's relevant but, the 0 and 255 are not random, the idea is to clamp a number as an 8-bit unsigned integer.
code-golf math tips javascript
New contributor
$endgroup$
|
show 2 more comments
$begingroup$
Imagine this short function to clamp a number between 0 and 255:
c = n => n > 0 ? n < 255 ? n : 255 : 0
Is this the shortest possible version of a clamp function with JavaScript (without ES.Next features)?
P.S: Not sure if it's relevant but, the 0 and 255 are not random, the idea is to clamp a number as an 8-bit unsigned integer.
code-golf math tips javascript
New contributor
$endgroup$
2
$begingroup$
Hi and welcome to PPCG! Just to be clear, any answer you receive here will not necessarily be a good idea to use in anything except for code golfing. Aside from that, if you care about what version / environment it has to work in you might want to specify it.
$endgroup$
– FryAmTheEggman
yesterday
1
$begingroup$
Oh, I'm well aware. I've updated the question a bit. Thank you :)
$endgroup$
– Ricardo Amaral
yesterday
2
$begingroup$
I don't know JS, but one way to clamp is to sort[0,n,255]
and take the middle element -- might that be shorter?
$endgroup$
– xnor
yesterday
1
$begingroup$
@xnor Unfortunately, the JSsort()
method uses a lexicographical comparison by default, so that would require an explicit callback. (Something like that.)
$endgroup$
– Arnauld
yesterday
5
$begingroup$
@Arnauld Wow, that's pretty silly. But it looks like it would be longer even if the sort was numerical.
$endgroup$
– xnor
yesterday
|
show 2 more comments
$begingroup$
Imagine this short function to clamp a number between 0 and 255:
c = n => n > 0 ? n < 255 ? n : 255 : 0
Is this the shortest possible version of a clamp function with JavaScript (without ES.Next features)?
P.S: Not sure if it's relevant but, the 0 and 255 are not random, the idea is to clamp a number as an 8-bit unsigned integer.
code-golf math tips javascript
New contributor
$endgroup$
Imagine this short function to clamp a number between 0 and 255:
c = n => n > 0 ? n < 255 ? n : 255 : 0
Is this the shortest possible version of a clamp function with JavaScript (without ES.Next features)?
P.S: Not sure if it's relevant but, the 0 and 255 are not random, the idea is to clamp a number as an 8-bit unsigned integer.
code-golf math tips javascript
code-golf math tips javascript
New contributor
New contributor
edited yesterday
Ricardo Amaral
New contributor
asked yesterday
Ricardo AmaralRicardo Amaral
1986
1986
New contributor
New contributor
2
$begingroup$
Hi and welcome to PPCG! Just to be clear, any answer you receive here will not necessarily be a good idea to use in anything except for code golfing. Aside from that, if you care about what version / environment it has to work in you might want to specify it.
$endgroup$
– FryAmTheEggman
yesterday
1
$begingroup$
Oh, I'm well aware. I've updated the question a bit. Thank you :)
$endgroup$
– Ricardo Amaral
yesterday
2
$begingroup$
I don't know JS, but one way to clamp is to sort[0,n,255]
and take the middle element -- might that be shorter?
$endgroup$
– xnor
yesterday
1
$begingroup$
@xnor Unfortunately, the JSsort()
method uses a lexicographical comparison by default, so that would require an explicit callback. (Something like that.)
$endgroup$
– Arnauld
yesterday
5
$begingroup$
@Arnauld Wow, that's pretty silly. But it looks like it would be longer even if the sort was numerical.
$endgroup$
– xnor
yesterday
|
show 2 more comments
2
$begingroup$
Hi and welcome to PPCG! Just to be clear, any answer you receive here will not necessarily be a good idea to use in anything except for code golfing. Aside from that, if you care about what version / environment it has to work in you might want to specify it.
$endgroup$
– FryAmTheEggman
yesterday
1
$begingroup$
Oh, I'm well aware. I've updated the question a bit. Thank you :)
$endgroup$
– Ricardo Amaral
yesterday
2
$begingroup$
I don't know JS, but one way to clamp is to sort[0,n,255]
and take the middle element -- might that be shorter?
$endgroup$
– xnor
yesterday
1
$begingroup$
@xnor Unfortunately, the JSsort()
method uses a lexicographical comparison by default, so that would require an explicit callback. (Something like that.)
$endgroup$
– Arnauld
yesterday
5
$begingroup$
@Arnauld Wow, that's pretty silly. But it looks like it would be longer even if the sort was numerical.
$endgroup$
– xnor
yesterday
2
2
$begingroup$
Hi and welcome to PPCG! Just to be clear, any answer you receive here will not necessarily be a good idea to use in anything except for code golfing. Aside from that, if you care about what version / environment it has to work in you might want to specify it.
$endgroup$
– FryAmTheEggman
yesterday
$begingroup$
Hi and welcome to PPCG! Just to be clear, any answer you receive here will not necessarily be a good idea to use in anything except for code golfing. Aside from that, if you care about what version / environment it has to work in you might want to specify it.
$endgroup$
– FryAmTheEggman
yesterday
1
1
$begingroup$
Oh, I'm well aware. I've updated the question a bit. Thank you :)
$endgroup$
– Ricardo Amaral
yesterday
$begingroup$
Oh, I'm well aware. I've updated the question a bit. Thank you :)
$endgroup$
– Ricardo Amaral
yesterday
2
2
$begingroup$
I don't know JS, but one way to clamp is to sort
[0,n,255]
and take the middle element -- might that be shorter?$endgroup$
– xnor
yesterday
$begingroup$
I don't know JS, but one way to clamp is to sort
[0,n,255]
and take the middle element -- might that be shorter?$endgroup$
– xnor
yesterday
1
1
$begingroup$
@xnor Unfortunately, the JS
sort()
method uses a lexicographical comparison by default, so that would require an explicit callback. (Something like that.)$endgroup$
– Arnauld
yesterday
$begingroup$
@xnor Unfortunately, the JS
sort()
method uses a lexicographical comparison by default, so that would require an explicit callback. (Something like that.)$endgroup$
– Arnauld
yesterday
5
5
$begingroup$
@Arnauld Wow, that's pretty silly. But it looks like it would be longer even if the sort was numerical.
$endgroup$
– xnor
yesterday
$begingroup$
@Arnauld Wow, that's pretty silly. But it looks like it would be longer even if the sort was numerical.
$endgroup$
– xnor
yesterday
|
show 2 more comments
1 Answer
1
active
oldest
votes
$begingroup$
20 bytes
For reference, this is the original version without whitespace and without naming the function:
n=>n>0?n<255?n:255:0
Try it online!
19 bytes
We can save a byte by inverting the logic of the ternary tests and using n>>8
to test whether $n$ is greater than $255$. Because of the bitwise operation, this will however fail for $nge 2^{32}$.
n=>n<0?0:n>>8?255:n
Try it online!
19 bytes
This one returns $false$ instead of $0$ but works for $nge 2^{32}$.
n=>n>255?255:n>0&&n
Try it online!
18 bytes
By combining both versions above, we end up with a function that works for $256-2^{32}le n<2^{32}$ and returns $false$ for $n<0$.
n=>n>>8?n>0&&255:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
n > 0 && // return false if n is negative
255 // or 255 otherwise
: // else:
n // return n unchanged
(This is a fixed revision of the code proposed by @ValueInk in the comments.)
17 bytes
We can go a step further by limiting the valid input range to $-2^{24}< nle 2^{24}$:
n=>n>>8?-n>>>24:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
-n >>> 24 // non-arithmetic right-shift of -n by 24 positions
: // else:
n // return n unchanged
$endgroup$
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go forn=>n>>8?255:n>0&&n
for 18 bytes, sincefalse
can be coerced to0
and this will make all negative numbers evaluate tofalse
$endgroup$
– Value Ink
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,n>>8
will be truthy for any negative input.
$endgroup$
– Arnauld
yesterday
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "200"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Ricardo Amaral is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f180949%2fis-it-possible-to-make-a-clamp-function-shorter-than-a-ternary-in-js%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
20 bytes
For reference, this is the original version without whitespace and without naming the function:
n=>n>0?n<255?n:255:0
Try it online!
19 bytes
We can save a byte by inverting the logic of the ternary tests and using n>>8
to test whether $n$ is greater than $255$. Because of the bitwise operation, this will however fail for $nge 2^{32}$.
n=>n<0?0:n>>8?255:n
Try it online!
19 bytes
This one returns $false$ instead of $0$ but works for $nge 2^{32}$.
n=>n>255?255:n>0&&n
Try it online!
18 bytes
By combining both versions above, we end up with a function that works for $256-2^{32}le n<2^{32}$ and returns $false$ for $n<0$.
n=>n>>8?n>0&&255:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
n > 0 && // return false if n is negative
255 // or 255 otherwise
: // else:
n // return n unchanged
(This is a fixed revision of the code proposed by @ValueInk in the comments.)
17 bytes
We can go a step further by limiting the valid input range to $-2^{24}< nle 2^{24}$:
n=>n>>8?-n>>>24:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
-n >>> 24 // non-arithmetic right-shift of -n by 24 positions
: // else:
n // return n unchanged
$endgroup$
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go forn=>n>>8?255:n>0&&n
for 18 bytes, sincefalse
can be coerced to0
and this will make all negative numbers evaluate tofalse
$endgroup$
– Value Ink
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,n>>8
will be truthy for any negative input.
$endgroup$
– Arnauld
yesterday
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
add a comment |
$begingroup$
20 bytes
For reference, this is the original version without whitespace and without naming the function:
n=>n>0?n<255?n:255:0
Try it online!
19 bytes
We can save a byte by inverting the logic of the ternary tests and using n>>8
to test whether $n$ is greater than $255$. Because of the bitwise operation, this will however fail for $nge 2^{32}$.
n=>n<0?0:n>>8?255:n
Try it online!
19 bytes
This one returns $false$ instead of $0$ but works for $nge 2^{32}$.
n=>n>255?255:n>0&&n
Try it online!
18 bytes
By combining both versions above, we end up with a function that works for $256-2^{32}le n<2^{32}$ and returns $false$ for $n<0$.
n=>n>>8?n>0&&255:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
n > 0 && // return false if n is negative
255 // or 255 otherwise
: // else:
n // return n unchanged
(This is a fixed revision of the code proposed by @ValueInk in the comments.)
17 bytes
We can go a step further by limiting the valid input range to $-2^{24}< nle 2^{24}$:
n=>n>>8?-n>>>24:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
-n >>> 24 // non-arithmetic right-shift of -n by 24 positions
: // else:
n // return n unchanged
$endgroup$
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go forn=>n>>8?255:n>0&&n
for 18 bytes, sincefalse
can be coerced to0
and this will make all negative numbers evaluate tofalse
$endgroup$
– Value Ink
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,n>>8
will be truthy for any negative input.
$endgroup$
– Arnauld
yesterday
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
add a comment |
$begingroup$
20 bytes
For reference, this is the original version without whitespace and without naming the function:
n=>n>0?n<255?n:255:0
Try it online!
19 bytes
We can save a byte by inverting the logic of the ternary tests and using n>>8
to test whether $n$ is greater than $255$. Because of the bitwise operation, this will however fail for $nge 2^{32}$.
n=>n<0?0:n>>8?255:n
Try it online!
19 bytes
This one returns $false$ instead of $0$ but works for $nge 2^{32}$.
n=>n>255?255:n>0&&n
Try it online!
18 bytes
By combining both versions above, we end up with a function that works for $256-2^{32}le n<2^{32}$ and returns $false$ for $n<0$.
n=>n>>8?n>0&&255:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
n > 0 && // return false if n is negative
255 // or 255 otherwise
: // else:
n // return n unchanged
(This is a fixed revision of the code proposed by @ValueInk in the comments.)
17 bytes
We can go a step further by limiting the valid input range to $-2^{24}< nle 2^{24}$:
n=>n>>8?-n>>>24:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
-n >>> 24 // non-arithmetic right-shift of -n by 24 positions
: // else:
n // return n unchanged
$endgroup$
20 bytes
For reference, this is the original version without whitespace and without naming the function:
n=>n>0?n<255?n:255:0
Try it online!
19 bytes
We can save a byte by inverting the logic of the ternary tests and using n>>8
to test whether $n$ is greater than $255$. Because of the bitwise operation, this will however fail for $nge 2^{32}$.
n=>n<0?0:n>>8?255:n
Try it online!
19 bytes
This one returns $false$ instead of $0$ but works for $nge 2^{32}$.
n=>n>255?255:n>0&&n
Try it online!
18 bytes
By combining both versions above, we end up with a function that works for $256-2^{32}le n<2^{32}$ and returns $false$ for $n<0$.
n=>n>>8?n>0&&255:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
n > 0 && // return false if n is negative
255 // or 255 otherwise
: // else:
n // return n unchanged
(This is a fixed revision of the code proposed by @ValueInk in the comments.)
17 bytes
We can go a step further by limiting the valid input range to $-2^{24}< nle 2^{24}$:
n=>n>>8?-n>>>24:n
Try it online!
Commented
n => // n = input number
n >> 8 ? // if n is greater than 255 or n is negative:
-n >>> 24 // non-arithmetic right-shift of -n by 24 positions
: // else:
n // return n unchanged
edited 21 hours ago
answered yesterday
ArnauldArnauld
77.9k695326
77.9k695326
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go forn=>n>>8?255:n>0&&n
for 18 bytes, sincefalse
can be coerced to0
and this will make all negative numbers evaluate tofalse
$endgroup$
– Value Ink
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,n>>8
will be truthy for any negative input.
$endgroup$
– Arnauld
yesterday
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
add a comment |
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go forn=>n>>8?255:n>0&&n
for 18 bytes, sincefalse
can be coerced to0
and this will make all negative numbers evaluate tofalse
$endgroup$
– Value Ink
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,n>>8
will be truthy for any negative input.
$endgroup$
– Arnauld
yesterday
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go for
n=>n>>8?255:n>0&&n
for 18 bytes, since false
can be coerced to 0
and this will make all negative numbers evaluate to false
$endgroup$
– Value Ink
yesterday
$begingroup$
Why stop there? If you're extremely liberal with what counts as a 0 (as JavaScript tends to do) you can always go for
n=>n>>8?255:n>0&&n
for 18 bytes, since false
can be coerced to 0
and this will make all negative numbers evaluate to false
$endgroup$
– Value Ink
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,
n>>8
will be truthy for any negative input.$endgroup$
– Arnauld
yesterday
$begingroup$
@ValueInk If you don't test $n<0$ beforhand,
n>>8
will be truthy for any negative input.$endgroup$
– Arnauld
yesterday
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
$begingroup$
Very nice, thank you so much!
$endgroup$
– Ricardo Amaral
20 hours ago
add a comment |
Ricardo Amaral is a new contributor. Be nice, and check out our Code of Conduct.
Ricardo Amaral is a new contributor. Be nice, and check out our Code of Conduct.
Ricardo Amaral is a new contributor. Be nice, and check out our Code of Conduct.
Ricardo Amaral is a new contributor. Be nice, and check out our Code of Conduct.
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f180949%2fis-it-possible-to-make-a-clamp-function-shorter-than-a-ternary-in-js%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
Hi and welcome to PPCG! Just to be clear, any answer you receive here will not necessarily be a good idea to use in anything except for code golfing. Aside from that, if you care about what version / environment it has to work in you might want to specify it.
$endgroup$
– FryAmTheEggman
yesterday
1
$begingroup$
Oh, I'm well aware. I've updated the question a bit. Thank you :)
$endgroup$
– Ricardo Amaral
yesterday
2
$begingroup$
I don't know JS, but one way to clamp is to sort
[0,n,255]
and take the middle element -- might that be shorter?$endgroup$
– xnor
yesterday
1
$begingroup$
@xnor Unfortunately, the JS
sort()
method uses a lexicographical comparison by default, so that would require an explicit callback. (Something like that.)$endgroup$
– Arnauld
yesterday
5
$begingroup$
@Arnauld Wow, that's pretty silly. But it looks like it would be longer even if the sort was numerical.
$endgroup$
– xnor
yesterday