Skip to content

Conversation

HerrCai0907
Copy link
Member

@HerrCai0907 HerrCai0907 commented Oct 12, 2025

json which has stderr will not check the execution and snopshot.

Comment on lines 81 to 87
// always true
assert(+.0 == -.0);
assert(-.0 != -.0);
assert(-.0 == -.0);
assert(-.0 == +.0);
assert(f32(+.0) == f32(-.0));
assert(f32(-.0) != f32(-.0));
assert(f32(-.0) == f32(-.0));
assert(f32(-.0) == f32(+.0));
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why this test was written this way...it looks more-or-less intentional(?)

In any case, the correct semantics would be those of JS/Wasm/IEEE-754 anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

The operator being == instead of != doesn't affect the hints in any way...does it? (If not, should it?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. it doesn't matter

> [email protected] asbuild:release
> asc assembly/index.ts --target release

WARNING AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.
   :
 1 │ f32(-0.0) != f32(-0.0);
   │ ~~~~~~~~~~~~~~~~~~~~~~
   └─ in assembly/index.ts(1,1)

WARNING AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.
   :
 3 │ f32(-0.0) == f32(-0.0);
   │ ~~~~~~~~~~~~~~~~~~~~~~
   └─ in assembly/index.ts(3,1)

@HerrCai0907 HerrCai0907 merged commit 6087191 into AssemblyScript:main Oct 17, 2025
15 checks passed
@HerrCai0907 HerrCai0907 deleted the fix/wrong-test branch October 17, 2025 02:48
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.

3 participants