Login  Register

Re: Java3D and Floating Point

Posted by ZacharyABCD on May 25, 2018; 12:55pm
URL: https://forum.jogamp.org/Java3D-and-Floating-Point-tp4038882p4038885.html


I'm after a solution to floating point arithmetic overflow and underflow woes,
in terms of the float and double types already there, and while using =,-,*,/,% (and further)
operators and not method invocation. Mainly for float and double, Float and Double,
but also in terms of true Arbitrary Precision Arithmetic; for numbers
that have an infinitely pro extensible precision and/or scale.
These are conditions that BigInteger and BigDecimal in fact do not always meet.
Naturally there would needs be a StrictMath equivalent for such.


I had been lead to believe that value types could/would be a basis for numeric
Integer/Decimal  positive/negative value types, definable by the programmer via
the language (with some implemented ones probably included too),
that could be ranged arithmetic types, with ranges simlar to Float.MIN_VALUE
and Float.MAX_VALUE,  Double.MIN_VALUE and Double.MAX_VALUE, and even further.
They would probably have StrictMath transcendental libraries included.

The use for these being more number types that support operator syntax,
that do not ever suffer from numeric flow and overflow, might be (push and pull)
convertable to previous type values at least, might allow for an infinite
number of decimal places in values (contingent to recurring decimal curtailing
submitted instruction, and the available memory of the jvm).

I would view the the JEP 306 change as absolutely necessary somehow, probably
with both options for floating point and range accuracy modes.  Such a change may need
to apply to precompiled code that doesn't allow for insertion of any new commands to change
localised, floating point denormal or abnormal vulnerable code.


The Vector3d.cross and Vector3f.cross methods in java3d 1.6 are cases in point;
of floating point overflow and underflow vulnerable code that has been put in place
inside the language/major libraries (of which java3d and vecmath are held),
which could return slightly range innacurate results which programmers cannot rely on.

So I had been hoping Valhalla will produce better syntactic arithmetic type support, certainly.

I had been trying to learn any more about these areas, certainly what and when
and how likely JEP 306 is, and how certain/how far reliant industry might expect
some change.

Since you have mentioned it, is Java3D and its javadoc finished, and if so whereabouts are they?

Is there anyone involved in Java3D who might know any better that could reply
to these three areas here?