Skip to content

Conversation

@texadactyl
Copy link
Collaborator

new unit test file: jvm/double_precision_repro_test.go
modified: jvm/interpreter.go

Copy link
Owner

@platypusguy platypusguy left a comment

Choose a reason for hiding this comment

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

In doFrem() can't the push be:
push(fr, float64(float32(math.Mod(val1), (val2))) ?

I don't think you need to convert val1 and val2 to float64 before doing the mod.

@texadactyl
Copy link
Collaborator Author

texadactyl commented Jan 21, 2026

val1 must be a float32 quantity, cast from a 64-bit stack entry quantity. This ensures that the value fits in a Java float.
Ditto for val2.

If these were integer casts we could do cheaper bit mask operations.

@platypusguy platypusguy merged commit 5fdaf11 into platypusguy:main Jan 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants