Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Allow relative speed of -0.0 #7740

Closed
wants to merge 1 commit into from

Conversation

SludgePhD
Copy link
Contributor

Objective

-0.0 should typically be treated exactly the same as 0.0, but this assertion was rejecting it while allowing 0.0. The Duration API handles this correctly (on recent Rust versions) and returns a zero Duration for both -0.0 and 0.0.

Solution

Check for ratio >= 0.0, which is true if ratio is -0.0.


Changelog

Allow relative speed of -0.0 in the Time::set_relative_speed_fXX methods.

@james7132 james7132 added C-Bug An unexpected or incorrect behavior A-Input Player input via keyboard, mouse, gamepad, and more S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Feb 18, 2023
@james7132
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 18, 2023
# Objective

-0.0 should typically be treated exactly the same as 0.0, but this assertion was rejecting it while allowing 0.0. The `Duration` API handles this correctly (on recent Rust versions) and returns a zero `Duration` for both -0.0 and 0.0.

## Solution

Check for `ratio >= 0.0`, which is true if `ratio` is `-0.0`.

---

## Changelog

Allow relative speed of -0.0 in the `Time::set_relative_speed_fXX` methods.
@bors bors bot changed the title Allow relative speed of -0.0 [Merged by Bors] - Allow relative speed of -0.0 Feb 18, 2023
@bors bors bot closed this Feb 18, 2023
@SludgePhD SludgePhD deleted the patch-1 branch February 18, 2023 22:58
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 20, 2023
# Objective

-0.0 should typically be treated exactly the same as 0.0, but this assertion was rejecting it while allowing 0.0. The `Duration` API handles this correctly (on recent Rust versions) and returns a zero `Duration` for both -0.0 and 0.0.

## Solution

Check for `ratio >= 0.0`, which is true if `ratio` is `-0.0`.

---

## Changelog

Allow relative speed of -0.0 in the `Time::set_relative_speed_fXX` methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants