Skip to content

Release 0.5.0 #5

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
merged 1 commit into from
Aug 5, 2023
Merged

Release 0.5.0 #5

merged 1 commit into from
Aug 5, 2023

Conversation

CoderGamester
Copy link
Owner

@CoderGamester CoderGamester commented Aug 5, 2023

Add new floatP object type to define a deterministic floating point

Summary by CodeRabbit

Release Notes:

  • New Feature: Introduces a new object type called floatP to the GameLovers.DataExtensions namespace.
  • Test: Includes a test class floatPTests in the GameLoversEditor.DataExtensions.Tests namespace, with three test methods (Representation(), Equality(), and Addition()) to verify the behavior of the floatP object type.

"A floatP emerges, bringing precision and power,
Tests dance in unity, ensuring its every hour.
With representation, equality, and addition in sight,
GameLovers rejoice, as bugs take flight."

Summary by CodeRabbit

Release Notes

New Feature

  • Introduced floatP, a deterministic floating-point number type, enhancing precision and predictability in mathematical operations.
  • Added arithmetic and comparison operators for floatP to support complex calculations.
  • Provided conversion methods between floatP and float types.

Test

  • Implemented comprehensive tests for floatP, ensuring its reliability and correctness in various scenarios.

🎉 A new dawn breaks with floatP in sight,
Precision and predictability taking flight.
Math now dances with deterministic delight,
In the realm of numbers, we've reached new height! 🚀

@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2023

Image description CodeRabbit

Walkthrough

This pull request introduces a new deterministic floating-point number type, floatP. It includes the implementation of arithmetic and comparison operations, conversion methods, and special values. The PR also adds a comprehensive suite of tests to ensure the correct behavior of the floatP type.

Changes

File(s) Summary
Runtime/GameLovers.DataExtensions.asmdef
Runtime/MathfloatP.cs.meta
Runtime/floatP.cs
Runtime/floatP.cs.meta
Introduced a new struct floatP that represents a deterministic floating-point number. This includes methods for creating floatP numbers, arithmetic and comparison operators, conversion to/from float, and properties for common special values.
Tests/Editor/floatPTests.cs
Tests/Editor/floatPTests.cs.meta
Added a test class floatPTests to validate the behavior of the floatP type. The tests cover representation, equality, addition, and multiplication operations, comparing floatP values with their corresponding float values.

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

Image description CodeRabbit

Walkthrough

The changeset introduces a new object type called floatP to the GameLovers.DataExtensions namespace. It also includes a test class floatPTests in the GameLoversEditor.DataExtensions.Tests namespace. The floatP object type represents a floating-point number with additional functionality. The floatPTests class contains three test methods that verify the behavior of the floatP object type, covering aspects such as representation, equality, addition, and multiplication of floatP values.

Changes

File Summary
Runtime/GameLovers.DataExtensions.asmdef Introduces the floatP object type to the GameLovers.DataExtensions namespace.
Tests/Editor/floatPTests.cs Contains the floatPTests class with test methods for verifying the behavior of the floatP object type.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between b00a687 and 9fb01aa commits.
Files selected (4)
  • Runtime/GameLovers.DataExtensions.asmdef (1)
  • Runtime/MathfloatP.cs (1)
  • Runtime/floatP.cs (1)
  • Tests/Editor/floatPTests.cs (1)
Files ignored due to filter (4)
  • Runtime/MathfloatP.cs.meta
  • Runtime/floatP.cs.meta
  • Tests/Editor/floatPTests.cs.meta
  • package.json
Files not summarized due to errors (2)
  • Runtime/MathfloatP.cs (diff tokens exceeds limit)
  • Runtime/floatP.cs (diff tokens exceeds limit)
Files skipped from review due to trivial changes (2)
  • Runtime/MathfloatP.cs (diff too large)
  • Runtime/floatP.cs (diff too large)
Review comments generated (3)
  • Review: 1
  • LGTM: 2

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between b00a687 and 9fb01aa commits.
Files ignored due to filter (1)
  • package.json
Files selected for processing (7)
  • Runtime/GameLovers.DataExtensions.asmdef (1 hunks)
  • Runtime/MathfloatP.cs (1 hunks)
  • Runtime/MathfloatP.cs.meta (1 hunks)
  • Runtime/floatP.cs (1 hunks)
  • Runtime/floatP.cs.meta (1 hunks)
  • Tests/Editor/floatPTests.cs (1 hunks)
  • Tests/Editor/floatPTests.cs.meta (1 hunks)
Files not summarized due to errors (1)
  • Runtime/MathfloatP.cs (diff tokens exceeds limit)
Files skipped from review due to trivial changes (2)
  • Runtime/MathfloatP.cs (diff too large)
  • Runtime/floatP.cs (diff too large)
Review comments generated (5)
  • Actionable : 5
  • LGTM (Skipped): 3
  • Noise Suppression (Skipped): 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Tag the bot with @coderabbitai in any review comment to ask it questions. The bot will not respond unless explicitly tagged.
  • A review comment is a comment on a diff or a file and not a comment on the PR itself.
  • You can use the mouse to select multiple lines of code to provide exact context to the bot.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +30 to +41
Assert.IsTrue(floatP.NaN != floatP.NaN);
Assert.IsTrue(floatP.NaN.Equals(floatP.NaN));
Assert.IsTrue(floatP.Zero == -floatP.Zero);
Assert.IsTrue(floatP.Zero.Equals(-floatP.Zero));
Assert.IsTrue(!(floatP.NaN > floatP.Zero));
Assert.IsTrue(!(floatP.NaN >= floatP.Zero));
Assert.IsTrue(!(floatP.NaN < floatP.Zero));
Assert.IsTrue(!(floatP.NaN <= floatP.Zero));
Assert.IsTrue(floatP.NaN.CompareTo(floatP.Zero) == -1);
Assert.IsTrue(floatP.NaN.CompareTo(floatP.NegativeInfinity) == -1);
Assert.IsTrue(!(-floatP.Zero < floatP.Zero));
}
Copy link

Choose a reason for hiding this comment

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

Image description CodeRabbit

The Equality test checks the behavior of floatP.NaN and floatP.Zero in comparison operations. It would be beneficial to also test the behavior of other floatP constants like floatP.PositiveInfinity, floatP.NegativeInfinity, floatP.One, and floatP.MinusOne in comparison operations.

+            Assert.IsTrue(floatP.PositiveInfinity > floatP.One);
+            Assert.IsTrue(floatP.NegativeInfinity < floatP.One);
+            Assert.IsTrue(floatP.One >= floatP.Zero);
+            Assert.IsTrue(floatP.MinusOne <= floatP.Zero);

@CoderGamester CoderGamester merged commit 3265428 into master Aug 5, 2023
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.

1 participant