80 questions
0
votes
0
answers
27
views
VB.NET 3.5 OdbcDataAdapter.Fill causes OverflowException after moving from Windows 10 x86 to Windows 11 x64
I’m maintaining a legacy VB.NET 3.5 Windows Forms app that worked perfectly on Windows 10 32-bit using MySQL ODBC Connector 5.1/5.3.
Recently, we migrated to a Windows 11 64-bit machine. Without ...
0
votes
1
answer
12
views
Need to understand OverflowException exception
Can someone please help me to know why below piece of code giving me Overflow exception even if I use long and double datatype of variable numValue:
tring[] inputValues = new string[] { "3", ...
1
vote
2
answers
680
views
CSharp: Failed to read LARGE .npy file. Exception is "NumSharp.dll Arithmetic operation resulted in an overflow."
I am trying to read a large .npy file in CSharp.
In order to do that i am trying to use the NumSharp nuget.
The file is 7GB jagged float array (float[][]). It has ~1 million vectors, each vector is a ...
0
votes
1
answer
1k
views
How to handle int and int64 when parsing json
I have a program that loops through json and grabs the values. This works find until it gets to an integer that is above what int32 handles.
2021-09-10 08:00:02.7576|ERROR|System.OverflowException: ...
0
votes
3
answers
112
views
how to handle the right overflowed
I created 3 three containers in row, it is working perfectly on emulator but when i run app on my andriod phone it is giving me right overflowed by 20 pixels error.
i found the solution to wrap it in ...
1
vote
2
answers
77
views
getting OverflowError in python
I need to express and use the following equation in Python code. However, I am getting an OverflowError when I substitute X = 340.15 in:
Y = [e^(-989)] * (X^171)
I did a quick search on Google but ...
0
votes
2
answers
898
views
Does C# throw OverflowException for floating point numbers?
Does C# compiler throw OverflowException for floating-point numeric types?
I tried this to figure it out:
try
{
checked
{
double d = Convert.ToDouble(Math.Pow(double.MaxValue, double....
-2
votes
1
answer
818
views
Overflow exception during sum of all the values of integer array in C#
Hi I was solving a very basic problem on Hackerrank about determining Mini-Max Sum of all the values in an integer array. Basically given an array of 5 values like [1, 2, 3, 4, 5], the minimum sum ...
1
vote
1
answer
225
views
How to calculate and write a very, very large number to a file in python?
This may seem like a duplicate question, and maybe it is, but I've checked many other sources and none of the solutions seem to work. The number I'm trying to calculate is 999,999^999,999, and it's ...
0
votes
1
answer
257
views
SQLiteDataReader OverflowException using SQLiteDataReader on decimal.MaxValue
Problem
This is partially me being my own worst enemy. I have unit tests that verify my ability to write and then retrieve all different base data types to/from a SQLite database. Among my tests I ...
1
vote
0
answers
427
views
java.lang.StackOverflowError: null JsonWriter.writeDeferredName but not using Json?
I know the title isn't the best, but the error is not clear at all to me. The error I have is this:
019-04-15 14:28:45.270 ERROR 12644 --- [nio-9090-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : ...
-4
votes
2
answers
2k
views
System.OverflowException when casting a System.IntPtr to a uint
I tried to save the MaximumApplicationAddress from SystemInfo into an uint, but I get a System Overflow Exception:
System.OverflowException: The arithmetic operation caused an overflow
I tried a lot ...
2
votes
1
answer
86
views
VB.NET OverflowException on very small operation
I'm trying to merge 2 colors and to do so I created a very simple function:
Public Function MixColors(color1 As Color, color2 As Color) As Color
Dim a, r, g, b As Byte
a = (color1.A + color2....
1
vote
1
answer
152
views
uwp NeighbourFilesQuery sometimes gives System.OverflowException
I use FileActivatedEventArgs args to do the file association in my video player app. So I when user double clicks a video file it opens and plays the file in my app, also it gets all the ...
2
votes
1
answer
2k
views
Catching OverflowError
In Python 3 I have a class representing a range [x,y] of values and computing the length of such range.
If the length is too large, I'm not sure how to catch the OverflowError exception inside the ...
0
votes
1
answer
309
views
exp() overflow error python 3
I tried various solutions for below, but I still get the errors as described:
log1p(1 + math.exp(comp * -1))
Error: OverflowError: math range error
So I changed it to: log1p(1 + np.exp(comp * -1))
...
0
votes
1
answer
409
views
Msg 8115 Arithmetic overflow error when I am trying to convert a balance amount
I need some help. I have created a view in sql 2012 that will take a persons id# and display an entry date and the balance that was entered on that date. I've tried to convert the balance and even ...
-2
votes
3
answers
7k
views
The value was either too small or too large for an unsigned byte C#
I have 2 methods, shown below, and i can't get it to work. I am trying to open a .png file from a OpenFileDialog and display it on a ImageBox:
public static Bitmap ToBitmap(this string input)
{
...
2
votes
2
answers
464
views
FileStream Overflow Exception
Get an overflow exception when trying to run an eof statement in the while loop Value was either too large or too small for a character
string filePath = @"C:\Users\Klanix\Desktop\NewC#\testfile2.txt"...
1
vote
1
answer
396
views
IntPtr cast to int causing OverflowException, why not caught by static code analysis?
I'm trying to find out if this scenario that caused an OverflowException could possibly be something that could be caught by static code analysis.
//IntPtr position = ...
position = (IntPtr) ((int) ...
0
votes
1
answer
933
views
Having trouble getting a percentage in visual basic
I keep getting an error when it come to getting a percentage as a part of a program.
The code is below as well as an image of the error pop up.
Also yes yes I know I can some up some code line and ...
-1
votes
1
answer
54
views
Overflow errors converting Python program to VB .NET
How are you?
In order to make the program I am working on more user-friendly and easier to deploy on Windows machines, I am in the process of converting an algorithm from Python (which works wonders) ...
0
votes
1
answer
2k
views
Jackson Serialize Circular References Stack overflow Error [duplicate]
I am trying to serialise my POJO which looks as follows using Jackson Object mapper, I get stack over flow exception, please help on this. Thanks in advance
public class ServiceCategoryModel {
...
0
votes
0
answers
124
views
OverFlowException Terminates the program. Should It?
In our windows service, an OverFlowException occurs (by a third party dll). However, there is a nice try/catch block available and as I know, this should NOT terminate the program and it is handle-...
0
votes
1
answer
102
views
Unable to migrate old project on new computer
I am getting an error when I try to migrate a old project on my new computer. On the old computer the database worked fine. The content of the database is of little importance, thats why I didnt bring ...
11
votes
1
answer
778
views
How can Decimal.Round() throw OverflowException
I'm using
Decimal.Round(decimal d)
MSDN says it can throw OverflowException
https://msdn.microsoft.com/en-us/library/k4e2bye2(v=vs.110).aspx
I'm not sure how that can happen. I tried looking over ...
0
votes
0
answers
1k
views
System Overflow Exception in System.Windows.Forms.DataVisualization.dll
I've got problem that makes me crazy - I think that's so easy that I can't even think about what is causing my problems.
I'm sending data (fft of generated acustic wave - frequencies and magnitude) ...
1
vote
0
answers
404
views
Converting a huge XPS document page to an image file
I have a preposterously large page (tens of thousands of pixels high and across, with tens of thousands of nodes and links) on an XPS document that I am attempting to convert to an image. The XPS ...
2
votes
1
answer
482
views
More than 32 links in LinkLabel?
I'm currently making an app in C# which make use of LinkLabels. I have a function that add a new link for each element in a certain array. However, it happens that the array have more than 32 links, ...
3
votes
1
answer
5k
views
Avoiding OverflowException when converting from double to decimal
When converting double (or float) to decimal, overflow exceptions are possible. So I've written this small extension method that prevents this by saturating:
public static decimal ToDecimalSafe(this ...
2
votes
0
answers
44
views
Why is an OverflowException raised in this situation? [duplicate]
Why isn't this code idempotent?
double.Parse(double.MinValue.ToString())
This will throw an OverflowException with the message
Value was either too large or too small for a Double
I would expect ...
1
vote
2
answers
334
views
bitwise complement of a character in C# vs C overflowexception
I have following code in C which will generate keys based on input serial number.
unsigned int32 passkey(unsigned int32 snumber)
{
char snstring[11];
unsigned int32 pwd;
int i = 0;
...
5
votes
1
answer
103
views
Why does int.MinValue % -1 cause and OverflowException [duplicate]
In 7.8.3. of the C# Specification regarding the Remainder operator it states the following:
If the left operand is the smallest int or long value and the right
operand is -1, a System....
0
votes
0
answers
577
views
OverflowException with Delimon Directory.Exists
I have a really strange error, with Delimon.Io library, I got an OverflowException when I call a Directory.Exists for an existing directory, ie.
Delimon.Win32.IO.Directory.Exists(@"c:\temp")
The ...
0
votes
1
answer
170
views
Get max value on arithmethic overflow
Is there a built-in way to get max value on arithmetic overflow?
Here's what I need:
var val = byte.MaxValue + 1;
//should be rounded down to byte.MaxValue
MyByteProperty = val;
P.S. I know I can ...
1
vote
1
answer
360
views
Why bitwise AND operator of big ULong number with constant causes OverflowException?
This code compiles successfully, but causes System.OverflowException in Visual Studio 2013 during execution:
Sub Main()
Dim a As ULong = 14345389830683080345D
Dim c As ULong = 1
Dim x As ...
1
vote
2
answers
3k
views
Cannot cast int32 to int16. Int16 type value is too large or too small
I want to cast an Int32 value to Int16 value. Data lost when casting is not a problem to me. But a System.OverflowException says the Int16 type value is too large or too small.
Dim num As Int32 = &...
0
votes
0
answers
311
views
VB.NET Convert.toDouble return a System.OverflowException
I have a problem with a convert.ToDouble and I don't find the answer on the net, stackOverFlow, etc...
I try to convert this string value "7,8" (same pb with another : "4,84232") to double.
Here ...
0
votes
2
answers
810
views
How can I determine which element is causing an overflow?
I've got this code:
String testData = File.ReadAllText("siteQueryTest.txt");
XDocument xmlDoc = XDocument.Parse(testData);
List<SiteQuery> sitequeries =
(from sitequery in xmlDoc.Descendants("...
0
votes
1
answer
368
views
inf not convertible to a float
For some reason after a while my code raises,
OverflowError: cannot convert float infinity to integer.
I can't see any reason why it would do this, there is little use of floats and no use of the inf, ...
49
votes
3
answers
3k
views
Why dividing int.MinValue by -1 threw OverflowException in unchecked context?
int y = -2147483648;
int z = unchecked(y / -1);
The second line causes an OverflowException. Shouldn't unchecked prevent this?
For example:
int y = -2147483648;
int z = unchecked(y * 2);
doesn't ...
2
votes
1
answer
69
views
Arithmetical Exceptions
I'm in a programming high school course, and my assignment is to write a program that uses: OverflowException, or NotFiniteNumberException. It has to be arithmetical and I've tried everything I can ...
1
vote
0
answers
45
views
Application-initiated datatype overflow security vulnerabilities in SQL Server 2012
Short Description:
Improper application validation passes invalid data into SQL update statements executed in SQL Server 2012, causing a server-side error which is not handled by the application. ...
1
vote
1
answer
435
views
Why do I get an OverflowException when using Graphics.ScaleTransform?
I have some drawing code for an editor I am working on. It draws a few lines and an image buffer. After adding a zoom features and calling ScaleTransform I get an OverflowException thrown in my paint ...
3
votes
1
answer
121
views
Where to put an arithmetic checked statement?
I'm reading about how to force an operation to throw an overflow exception, and on the "try it yourself" section, I had it in a different place than the book. I'm curious if there's a performance ...
8
votes
1
answer
2k
views
Meaning of error numbers in Python exceptions
Catching Python's OverflowError after some dumb calculation, I checked the error's args and saw it's a tuple containing an integer as its first coordinate. I assume this is some kind of error number (...
0
votes
2
answers
2k
views
Allow Addition Overflow in vb.net
I'm working on a vb.net app that needs to add multiple integers together. The integers are to be unsigned, and 32 bits in length.
It is expected that the integers will be so large that they will ...
1
vote
1
answer
100
views
Can I make sure that no exception happens on overflow integer miltiplication?
I am writing a code that do some arithmetic on long values and it should NOT generate an overflow exception.
The code needs to be compiled both on windows (visual studio ) and Linux (ARM Linux).
Is ...
-2
votes
4
answers
5k
views
SqlDateTime overflow exception (yyyy-mm-dd to sqldatetime)
I'm extracting a date-formatted string (yyyy-MM-dd) and then converting it to a DateTime and inserting it in the database using a storedprocedure. But I keep getting
System.Data.SqlTypes....
2
votes
0
answers
130
views
OverflowException with NHibernate and Oracle SDO_ORDINATE_ARRAY
I'm getting an OverflowException when trying to query an SDO_ORDINATE_ARRAY from an Oracle database with NHibernate.
The exception is thrown in Oracle.DataAcess in the public static unsafe object ...