|
Answered my own question.
It seems this is the IEEE standard way of handling floating point numbers:
Divide by zero exception[^]
from msdn: Dividing a floating-point value by zero will result in either positive infinity, negative infinity, or Not-a-Number (NaN) according to the rules of IEEE 754 arithmetic. Floating-point operations never throw an exception.
Single structure[^]
from msdn: If the magnitude of the result of a floating-point operation is too large for the destination format, the result of the operation is PositiveInfinity or NegativeInfinity, as appropriate for the sign of the result.
Simon
|
|
|
|
|
Thanks Simon,
1.
From the links you referred, here is the information I found related to this question. So, it means only int and decimal type has DivideByZeroException? Float/Double escape this situation?
--------------------
The exception that is thrown when there is an attempt to divide an integral or decimal value by zero.
--------------------
2.
What else information do you find relates to the question I asked in the two links you referred?
regards,
George
|
|
|
|
|
But still, the result of division by zero is undefined, not infinite.
|
|
|
|
|
PIEBALDconsult wrote: the result of division by zero is undefined, not infinite
Not according to the IEEE, and they make the rules.
Simon
|
|
|
|
|
PIEBALDconsult wrote: But still, the result of division by zero is undefined, not infinite.
Nah. The result is nullity[^].
|
|
|
|
|
Dagnabit! Now I have to add a Nullity property to my Rational class.
|
|
|
|
|
Thanks Simon,
So, the conclusion is since float has infinity value, there is no exception, but since int does not have infinity value (only has max/min value), exception will occur?
regards,
George
|
|
|
|
|
Thanks Guffa,
I think your reply makes senses. Int only has max and min value, no infinite value, but float has, right?
regards,
George
|
|
|
|
|
Only Chuck Norris can divide by zero.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
[chuckle] Chris himself making CN jokes in the programming forums.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Hi
iam in windows application using c#.
my database is "FireBird Database".
Database path is :
string dsRelativePath = "database\\absolutemedia.fdb";
string dsAbsolutePath = Path.GetFullPath(dsRelativePath);
string ConnectionString = "ServerType=1;User=SYSDBA;Password=masterkey;Database=" +dsAbsolutePath;
//Code for upload image
OpenFileDialog opn = new OpenFileDialog();
opn.Filter = "JPEG|*.jpg|GIF|*.gif";
opn.ShowDialog();
if (opn.FileName.Length > 0)
{
this.IMG = Image.FromFile(opn.FileName);
browsetext.Text = opn.FileName;
this.resizeHeight = 240;
this.resizeWidth = 320;
IMG = this.resizeImage(IMG, new Size(resizeWidth, resizeHeight));
imagebox.Image = IMG;
}
This path is working fine upto now..
but in my application, i have an option to upload images from local drives..iam browisng an image thru "OpenFileDialog".. after selecting an image .when iam going to save ,
database path i,e dsAbsolutePath is changed to image path.it's giving error in database connection...
Error---"I/O error for file CreateFile (open) "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\database\absolutemedia.fdb"
please reply where the problem is ?
how can i rectify this .
murali krishna
|
|
|
|
|
Dear all
using Visual C# how could i making function running every 2 minutes in background of specified form by itself and must be in asynchronous mode
like checking the price of currencies or doing something inside database
thanks for all
MFC programmer
|
|
|
|
|
Use a Timer.
But remember the timer elapsed events get triggered on a different thread, so you'll need to do an Invoke call if you want to work with any GUI objects.
Simon
|
|
|
|
|
thank u sir
i have done manythings like:
using the background control to operate database processes
and used timer whith specific time interval to run the background asynchronously
best regards
modified on Thursday, April 24, 2008 5:52 AM
|
|
|
|
|
I was wondering...
There's a SendKeys function to send keys...
What about a SendClick(x, y); function?
Does one exist, that I just don't know about?
(I'm trying to avoid messy DllImports )
|
|
|
|
|
Not sure if it's exactly what you want, but my guess is you wanna click a particular button. Is myButton.PerformClick(); what you're looking for?
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Oh Cool!
Was more looking for MouseClick(x, y); for automation purposes, but WOW! That's useful!!!
Just wondering why it works in normal windows forms, but not with ASP.NET Buttons :p
|
|
|
|
|
I got this script for reading session values using Javascript
code>var color='<%= Session("color").ToString() %>'
But my requirement is to store Session values using Javascript.Can any one plz tell me how to do it ?
Thanks in Advance
|
|
|
|
|
I think u cannot assign a session using javascript that's coz session is set at server side for particular client..however u can retrieve the value from session which u have done...
Also u have posted in the wrong forum javascript in C# ?????
.....
|
|
|
|
|
Oke i feel like an major idiot for asking but i'll ask it anyway,
I've for an multible forms,
and i want when i press an key it switches to another form i created,
i was looking over the coding and i tought
Application.ActiveForm would do the trick but it doens't
So what does??
thanks in advance
Ben
|
|
|
|
|
are you looking on form.show()?
|
|
|
|
|
Exually what i have are 6 forms,
and 6 buttons
what i'm looking for is :
button 1 > form 2 + backbutton
button 2 > form 3 + backbutton
button 3 > form 4 + backbutton
button 4 > form 5 + backbutton
button 5 > form 6 + backbutton
button 6 > form 7 + backbutton
button 1 when pressed opens form 2 ect.
that works with form.hide(); ? and form.show(); ?
|
|
|
|
|
I tryed to use
Form.ActiveForm.Hide();
Form2.ActiveForm.Show();
but that trows System.NullReferenceException was unhandled
|
|
|
|
|
You need to create an instance of the form you wish to show/hide, that's the exception you're seeing.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
so i need to create 6 instanses, cause i got 6 forms?
|
|
|
|