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

Lua tests #3373

Merged
merged 8 commits into from
Dec 1, 2022
Merged

Lua tests #3373

merged 8 commits into from
Dec 1, 2022

Conversation

CasualPokePlayer
Copy link
Member


[LuaMethod("pass_f128", "")]
public static void PassF128(decimal? o)
=> Assert.IsTrue(o == (decimal?)ExpectedValue);
Copy link
Member

Choose a reason for hiding this comment

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

decimal is not binary128

Copy link
Member Author

@CasualPokePlayer CasualPokePlayer Sep 10, 2022

Choose a reason for hiding this comment

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

https://docs.microsoft.com/en-us/dotnet/api/system.decimal?view=netstandard-2.0
"The binary representation of a Decimal value is 128-bits consisting of a 96-bit integer number, and a 32-bit set of flags representing things such as the sign and scaling factor used to specify what portion of it is a decimal fraction."

Different significand/exponent width compared to binary128 but it adds up to 128 bits in the end.

EDIT: Also decimal uses a 10 exponent instead of a 2 exponent for some reason, thanks Microsoft?

@CasualPokePlayer CasualPokePlayer marked this pull request as ready for review September 11, 2022 00:13
@CasualPokePlayer CasualPokePlayer merged commit fdbb34d into TASEmulators:master Dec 1, 2022
@CasualPokePlayer CasualPokePlayer deleted the lua_tests branch December 1, 2022 07:55
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.

2 participants