LLVM fp128 type

LLVM implements the IEEE 128 bit float type (LLVM fp128). Can we have it as a new data type in Xojo? Something like a “Quad” type?

This will solve precision errors like we have processing large numbers as those currently using the Currency type.
Scientists and any user of very large or very small values will have benefits, not only the financial markets.

http://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format

http://llvm.org/docs/LangRef.html#floating-point-types

Dim GlobalValue As Currency = 3726192846283.8363
GlobalValue = GlobalValue + (GlobalValue * 0.0002311) // Internally it will be calculated using Quads and rounded to Currency
GlobalValue = GlobalValue + 12312424213453.7653 - 12312422303752.3894 // Using quads internally it works

Hm, I could implement this as a plugin, right?

Dim CosmicValue As Quad = 143616394781629364291876.88877723423

Not sure. But I would prefer natively, having a new data type and solving all sorts of intermediate overflows and errors. :wink:

Another issue to consider is that Xojo doesn’t promote math variables to the largest type when executing your function, so signing on to <https://xojo.com/issue/4920> would also be an important consideration for large (or small) math operations.

<https://xojo.com/issue/38472>

Or people could just use those that already exist and have for years
http://delaneyrm.com

[quote=172669:@Norman Palardy]Or people could just use those that already exist and have for years
http://delaneyrm.com[/quote]
Not available in iOS though :stuck_out_tongue:

no plugins are or have been so its not really “new” or “news”

Right, thats why it would need to be added to the framework. I’m not arguing either way - I’m simply pointing out that it’s not available in iOS since there is no plugin support at this time.

It does not help to fix the Xojo precision errors as already debated, and give us a wonderful “sub-product” of a “Quad” type. It’s READY in LLVM, why not just use it? Python, Haskel, Scala and Rust have implementations of it from LLVM.