Wii VC Round-to-Zero: Difference between revisions

no edit summary
mNo edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 4: Line 4:


When converting a {{w|Double-precision floating-point format|double-precision floating point number}} (a ''double'') to a {{w|Single-precision floating-point format|single-precision floating point number}} (a ''float''), some doubles will have to be {{w|Rounding|rounded}} to a nearby float. There is a discrepancy in the rounding mode used:
When converting a {{w|Double-precision floating-point format|double-precision floating point number}} (a ''double'') to a {{w|Single-precision floating-point format|single-precision floating point number}} (a ''float''), some doubles will have to be {{w|Rounding|rounded}} to a nearby float. There is a discrepancy in the rounding mode used:
*The Nintendo 64 typically uses the {{w|Rounding#Rounding to the nearest integer|''round-to-nearest''}} mode. This means that if the double is not exactly equal to a float, it will round up or down to the float that is closest in value to the original number. This behavior is accurately emulated by most emulators and the Wii U VC.
*The [[Nintendo 64]] typically uses the {{w|Rounding#Rounding to the nearest integer|''round-to-nearest''}} mode. This means that if the double is not exactly equal to a float, it will round up or down to the float that is closest in value to the original number. This behavior is accurately emulated by most emulators and the Wii U VC.
*The Wii VC instead effectively uses a {{w|Rounding#Rounding toward zero|''round-toward-zero''}} mode. This mode rounds all positive doubles down, and all negative doubles up, to the nearest float.
*The Wii VC instead effectively uses a {{w|Rounding#Rounding toward zero|''round-toward-zero''}} mode. This mode rounds all positive doubles down, and all negative doubles up, to the nearest float.


Line 25: Line 25:
Using the N64's rounding mode, {{code|y}} will repeatedly return to its original value and continue oscillating with fixed maximum height. Even though each double-to-single conversion produces a small amount of error, this error balances out over the course of the platform's cycle. On the Wii VC, however, the error always accumulates in the same direction (upward if the platform is below {{var|y}} = 0, and downward if the platform is above {{var|y}} = 0), and so the platform slowly drifts in the vertical direction.
Using the N64's rounding mode, {{code|y}} will repeatedly return to its original value and continue oscillating with fixed maximum height. Even though each double-to-single conversion produces a small amount of error, this error balances out over the course of the platform's cycle. On the Wii VC, however, the error always accumulates in the same direction (upward if the platform is below {{var|y}} = 0, and downward if the platform is above {{var|y}} = 0), and so the platform slowly drifts in the vertical direction.


The platforms at the bottom floor in BitFS are below {{var|y}} = 0, and so they gradually rise upward. As a result, the bug is of interest to the [[A Button Challenge]], since it lets Mario ride the platforms up to skip a pole that requires an A press to dismount.
The platforms at the bottom floor in BitFS are below {{var|y}} = 0, and so they gradually rise upward. As a result, the bug is of interest to the [[A Button Challenge]], since it lets Mario ride the platforms up to skip a [[pole]] that requires pressing {{button|A}} to dismount.


The platforms at the top floor in BitFS are above {{var|y}} = 0, and so they gradually fall downward.
The platforms at the top floor in BitFS are above {{var|y}} = 0, and so they gradually fall downward.
Line 54: Line 54:


This bug does not affect the sinking platforms in [[Lethal Lava Land]] because they are already located at {{var|y}} = 0.
This bug does not affect the sinking platforms in [[Lethal Lava Land]] because they are already located at {{var|y}} = 0.
In June 2026, it was discovered that the round-to-zero glitch meant a glitchy ledge grab in TTC, used in the A Button Challenge, was not possible on Wii VC due to the wall alignment being slightly different. This meant that the 4 A press saves in TTC in 2022 could not be done on Wii VC, making them the least optimal versions for 120 Star.


==References==
==References==