Skip to content

A ^= B is not the same as A = A ^ B when A is a real #9571

@YellowAfterlife

Description

@YellowAfterlife

Description

Given the following,

function scr_a_bug() {
	var i, k = 1 << 53;
	i = 2147483647;
	show_debug_message($"i: {i}, is_real: {is_real(i)}, is_int64: {is_int64(i)}");
	i = i ^ k;
	show_debug_message($"i: {i}, is_real: {is_real(i)}, is_int64: {is_int64(i)}");
	i = 2147483647;
	i ^= k;
	show_debug_message($"i: {i}, is_real: {is_real(i)}, is_int64: {is_int64(i)}");
}

The output is

i: 2147483647, is_real: 1, is_int64: 0
i: 9007201402224639, is_real: 0, is_int64: 1
i: 9007201402224640, is_real: 1, is_int64: 0

Which is a little unexpected.

Project file

Expected Change

No response

Steps To Reproduce

  1. Open the test project
  2. Run in either VM or YYC
  3. Observe

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.11.0 (Monthly)

Which platform(s) are you seeing the problem on?

Windows

Sample Package Attached?

  • I have attached my bug package

Sample Project Added?

  • I have included a small sample project

Metadata

Metadata

Assignees

Labels

GMRT_CHECKEDFix was verified in the GMRT runnergms2-bugIn-game bugs with the "GameMaker Studio 2" runtimes
No fields configured for In-Game Bug.

Projects

Status
Verified

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions