Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kwxm/plc spec/bitwise conversions #5911

Merged
merged 12 commits into from
Apr 22, 2024
Merged

Conversation

kwxm
Copy link
Contributor

@kwxm kwxm commented Apr 18, 2024

[PLT-8189] This adds the two new integer/bytestring conversions to the specification. See p35-36 of the attached PDF for a readable version.

plutus-core-specification.pdf

@kwxm kwxm added Specification Documentation No Changelog Required Add this to skip the Changelog Check labels Apr 18, 2024
@ramsay-t
Copy link
Contributor

Are the subscripts LE and BE spelt out somewhere?


\noindent Now assume that none of the conditions above hold, so $0 < n < 2^{65536}$ and
$0 \leq w \leq 8192$. Since $n>0$ we can write
$n = \sum_{i=0}^{N-1}a_{i}256^i$ with $N \geq 1$ and $a_{N-1} \ne 0$. We then have
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, maybe it's a stupid question, but I don't understand why we can write n as that sum. Can you provide some more explanations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's a base-256 expansion: I'll try to explain that a bit more clearly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I forgot to say that the a_i are supposed to lie between 0 and 255. I've fixed that now.

@kwxm
Copy link
Contributor Author

kwxm commented Apr 19, 2024

Are the subscripts LE and BE spelt out somewhere?

I just had to introduce those because there wasn't room to get the full definition into the table. I think I assumed it would be obvious what they stood for given the discussion of endianness, but it wouldn't do any harm to stick in a comment saying "(hence the subscripts LE and BE)" or something.

@kwxm kwxm merged commit 2e2a7fb into master Apr 22, 2024
5 checks passed
@kwxm kwxm deleted the kwxm/plc-spec/bitwise-conversions branch April 22, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants