Skip to content

Commit

Permalink
Fixed handling BigNumber values for slice indices.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason McCampbell (Enthought, Inc) committed Apr 22, 2011
1 parent 7cced41 commit 91515c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
6 changes: 3 additions & 3 deletions numpy/NumpyDotNet/NpyIndexes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void AddIndex(ISlice slice)
}
else
{
step = (IntPtr) Convert.ToInt64(slice.Step);
step = NpyUtil_ArgProcessing.IntpConverter(slice.Step);
negativeStep = (step.ToInt64() < 0);
}

Expand All @@ -277,7 +277,7 @@ public void AddIndex(ISlice slice)
}
else
{
start = (IntPtr) Convert.ToInt64(slice.Start);
start = NpyUtil_ArgProcessing.IntpConverter(slice.Start);
}


Expand All @@ -288,7 +288,7 @@ public void AddIndex(ISlice slice)
}
else {
hasStop = true;
stop = (IntPtr) Convert.ToInt64(slice.Stop);
stop = NpyUtil_ArgProcessing.IntpConverter(slice.Stop);
}

// Write the type
Expand Down
2 changes: 2 additions & 0 deletions numpy/NumpyDotNet/NpyUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ internal static long ConvertToLong(object obj, CodeContext cntx = null) {
return (long)obj;
} else if (obj is int) {
return (long)(int)obj;
} else if (obj is BigInteger) {
return (long)(BigInteger)obj;
} else if (obj is ScalarInt64) {
return (long)(ScalarInt64)obj;
} else if (obj is ScalarInt32) {
Expand Down
16 changes: 4 additions & 12 deletions numpy/random/mtrand/mtrand.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,10 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="IronPython, Version=2.7.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1">
<HintPath>..\..\..\..\IronPython\bin\Debug\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules, Version=2.7.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1">
<HintPath>..\..\..\..\IronPython\bin\Debug\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1">
<HintPath>..\..\..\..\IronPython\bin\Debug\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1">
<HintPath>..\..\..\..\IronPython\bin\Debug\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="IronPython" />
<Reference Include="IronPython.Modules" />
<Reference Include="Microsoft.Dynamic" />
<Reference Include="Microsoft.Scripting" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Numerics" />
Expand Down

0 comments on commit 91515c8

Please sign in to comment.