Skip to content

Commit

Permalink
Breaking change from double to int fixed #100
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Nov 21, 2024
1 parent 1d9bdd0 commit c13c66e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion YantraJS.Core/Core/JSValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public virtual int Length {

public abstract JSValue TypeOf();

public virtual int IntValue => (int)(uint)this.DoubleValue;
public virtual int IntValue => (int)((long)this.DoubleValue << 32) >> 32;

/// <summary>
/// Integer value restricts value within int.MaxValue and
Expand Down
2 changes: 1 addition & 1 deletion YantraJS.Core/Core/Number/JSNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public JSNumber(double value) : base()
this.value = value;
}

public override int IntValue => (int)(uint)value;
public override int IntValue => (int)(((long)value << 32) >> 32);

public override double DoubleValue => value;

Expand Down
2 changes: 1 addition & 1 deletion YantraJS/YantraJS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>YantraJS</AssemblyName>
<PackageId>YantraJS</PackageId>
<PackageTags>yantra,yantrajs,javascript,c#,standard,core,framework,.net</PackageTags>
Expand Down

0 comments on commit c13c66e

Please sign in to comment.