• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Does O2 has an integer function ?

Started by Chris Chancellor, May 07, 2018, 12:56:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charles Pegge

#15
In OxygenBasic, all numeric values are passed on the 80bit FPU stack for conversion to Ascii Decimal. It is currently configured to cut off at 17 digits precision, independent of the decimal point position.

in 32bit mode, Extended values can be passed to functions directly, and occupy 12 bytes on the stack. However, in 64bit mode, this is currently not allowed, and the values must be passed by reference.

BTW
I doubt that NASA would require any outputs above single precision, since, in the real world, physical factors at every level, such as multiple gravitational fields, and thermal expansion would out-scale it.

Mike Lobanovsky

#16
Lisp and its descendants support the notion of precise and imprecise numbers. Floating-point whole numbers and decimal fractions are imprecise while whole integers and common fractions are precise. The n/d common fraction format allows any number to be represented with absolute precision, and it also allows any mathematical operation to be performed (separately on the fraction numerator and denominator) without intermediate conversions and thus without loss in absolute precision.

I'd say half-float precision (that's 3 places after decimal point) is sufficient to describe the real world phenomena decently enough. At least most contemporary game consoles where all the GPU cores support half-float calc natively, are pretty good at rendering animated 3D objects with picture perfect quality and stunning natural looking lighting and physics.

NASA and DoD were mentioned not so much in relation to precision but more from the perspective of reliability and consistency of the language, and the adequacy and self-discipline of its creators.

:)

(IIRC, MASM supports REAL10 and TBYTE descriptors to directly define the 80-bit floating-point precision type and storage size, respectively, and thus doesn't waste a byte of its resources)
Mike
(3.6GHz Intel Core i5 w/ 16GB RAM, 2 x GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)