Forum > General

Is this a bug? External: SIGFPE

(1/4) > >>

Isenbeck:

I am having this error message: Project Project3D raised exception class 'External: SIGFPE'


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if w <> 0 then  begin    outVector.x := outVector.x / w;              <- Error is here    outVector.y := outVector.y / w;    outVector.z := outVector.z / w;  end;
It cannot be "division by zero" error because code verifies if w is zero.

The value of outVector record is following:
outVector = record VECTOR3D {
  X = 0.68582887700534767,
  Y = 2.1648889418968406e-316,
  Z = -0.10001000100010002}
var outVector: Vector3D = record

and value of w is:
w = 1.0359149494331584e-316
var w: real = type Double

I don't see why there would be an error? Is this a bug?
I have tried to replace outVector.x with a simple real variable (aValue: real) and still have the fault. So, it is also not because of outVector being a record.
 
Any ideas?

MarkMLl:
It's not "division by zero", it's "quotient out of range". You've not shown us a compilable example: what's the /exact/ definition of those types and what platform are you on?

MarkMLl

Isenbeck:

--- Quote from: MarkMLl on November 29, 2021, 07:55:55 pm ---It's not "division by zero", it's "quotient out of range". You've not shown us a compilable example: what's the /exact/ definition of those types and what platform are you on?

MarkMLl

--- End quote ---

The operating system is Windows 10, 64 bit.
Here is the definition of the record:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  Vector3D = record    x, y, z: real;  end;So... every field in the record is of type REAL. Also is the variable 'w'.
And like I said... To eliminate the possibility that the problem is with the field of a record, I have created a variable of type real, gave it some value (other than zero), and tried with that. It made the same error when divided with 'w'.
Values are given in my first post.

winni:
Hi!

Even if the range was not real but double:

You are out of range.

The Value of minDouble is

2.2250738585072014e-308 

Your value for y is

 Y = 2.1648889418968406e-316

which is smaller than minDouble.

You are beyond the range of any 64-bit float.

Winni

MarkMLl:
You DID NOT show us a sensible definition of your types.


--- Code: ---var w: real = type Double

--- End code ---

Check what real is on that platform... https://www.freepascal.org/docs-html/current/prog/progsu158.html#x202-2070008.2.5 suggests that it's double but in general you're better off using single/double/extended explicitly.

Check whether using an explicit double fixes the problem. I don't think you've got 80-bit extended available which is a pity.

MarkMLl

Navigation

[0] Message Index

[#] Next page

Go to full version