Skip to content

Implementation of arithmetic operators (including neg)#8

Merged
AdrianKrauss merged 6 commits intomasterfrom
adrians-test-branch2
Nov 12, 2024
Merged

Implementation of arithmetic operators (including neg)#8
AdrianKrauss merged 6 commits intomasterfrom
adrians-test-branch2

Conversation

@AdrianKrauss
Copy link
Copy Markdown
Collaborator

Implementation of the arithmetic operations based on the following paper:
https://ieeexplore.ieee.org/abstract/document/9741267

Basic testing was conducted using the python script.

@AdrianKrauss AdrianKrauss linked an issue Nov 11, 2024 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@Draggon01 Draggon01 left a comment

Choose a reason for hiding this comment

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

Eher Fragen als Anmerkungen, aber vll. kannst dus dir kurz anschauen.

@AdrianKrauss AdrianKrauss merged commit 1338d65 into master Nov 12, 2024
AdrianKrauss added a commit that referenced this pull request Nov 12, 2024
Comment on lines +1241 to +1244
let min ik (z,o) =
let z_cast = Size.cast ik (Ints_t.to_bigint (Ints_t.lognot z)) in
let o_cast = Size.cast ik (Ints_t.to_bigint z) in
Z.min z_cast o_cast
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Sicher dass das funktioniert?

Angenommen wir casten in einen datentyp, der signed ist und groß genug ist.
Bei bf = ofInt(1) haben wir ja die masken ist bf = {o=1, z=-2)
Du würdest ja result = min(z, ~z) = min (-2, 1) = -2 berechnen was falsch ist.

Das gleiche problem gibts auch bei der max funktion. Oder übersehe ich was?

@ManuelLerchner ManuelLerchner deleted the adrians-test-branch2 branch November 19, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

How to implement arithmetic operations

3 participants