High precision floats

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

High precision floats

Martin Shetty
<script type="text/x-mathjax-config">MathJax.Hub.Register.StartupHook("NativeMML Jax Ready", function () {MathJax.OutputJax.NativeMML.Augment({preTranslate: function (state) { var scripts = state.jax[this.id]; for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; if (!script.parentNode) continue; // Remove any existing output var prev = script.previousSibling; if (prev && prev.className === "MathJax_MathML") prev.parentNode.removeChild(prev); // Add the MathJax span var jax = script.MathJax.elementJax; if (!jax) continue; var math = jax.root; jax.NativeMML = {}; var type = (math.Get("display") === "block" ? "div" : "span"); var span = MathJax.HTML.Element(type,{ className: "MathJax_MathML", id:jax.inputID+"-Frame" },[["span",{ className:"MathJax_MathContainer", isMathJax: true, jaxID:this.id, },[["span",{isMathJax:true}]] ]]); script.parentNode.insertBefore(span,script); } }});MathJax.OutputJax.NativeMML.ffTableWidthBug = false;MathJax.OutputJax.NativeMML.forceReflow = false;MathJax.OutputJax.NativeMML.widthBug = false;MathJax.OutputJax.NativeMML.spaceWidthBug = false;MathJax.OutputJax.NativeMML.mtdWidthBug = false;});MathJax.Hub.Register.StartupHook("End Extensions", function () {if (MathJax.Extension.mml2jax) { for (var i=0,m=MathJax.Hub.preProcessors.hooks.length; i < m; i++) { if (MathJax.Hub.preProcessors.hooks[i].hook === MathJax.Extension.mml2jax.PreProcess) { MathJax.Hub.preProcessors.hooks.splice(i,1); i--; m--; } }}});</script>
I see from documentation that you can define custom floating types. Are there any examples out there for how to do this with GMP or MPFR? Or perhaps even more conveniently with boost/multiprecision?
http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html
Would (should?) hdfview also be able to understand these types? It sees 'long double' as opaque, but this one is not truly multiplatform so it is not of as much interest anyway.

P.S. Is there any way to search the HDF mailing list's archive other than downloading the gzips and grepping them? ;) I don't see any search capability on the website.

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High precision floats

Nelson, Jarom

The forum history is searchable on nabble:

http://hdf-forum.184993.n3.nabble.com/

 

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Martin Shetty
Sent: Wednesday, March 15, 2017 4:55 PM
To: [hidden email]
Subject: [Hdf-forum] High precision floats

 

I see from documentation that you can define custom floating types. Are there any examples out there for how to do this with GMP or MPFR? Or perhaps even more conveniently with boost/multiprecision?
http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html
Would (should?) hdfview also be able to understand these types? It sees 'long double' as opaque, but this one is not truly multiplatform so it is not of as much interest anyway.

P.S. Is there any way to search the HDF mailing list's archive other than downloading the gzips and grepping them? ;) I don't see any search capability on the website.


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High precision floats

Nelson, Jarom

To answer your question though, there is an example in the HDF5 User’s Guide, section 6.5.2.1

 

 

To illustrate a user-defined floating point number, the example below shows how to create a 24-bit float­ing point number that starts 5 bits into a 4 byte word. The floating point number is defined to have a man­tissa of 19 bits (bits 5-23), an exponent of 3 bits (25-27), and the sign bit is bit 28. (Note that this is an illustration of what can be done and is not necessarily a floating point format that a user would require.)

hid_t dt;

 

dt = H5Tcopy(H5T_IEEE_F32LE);

 

H5Tset_precision(dt, 24);

H5Tset_fields (dt, 28, 25, 3, 5, 19);

H5Tset_pad(dt, H5T_PAD_ZERO, H5T_PAD_ONE);

H5Tset_inpad(dt, H5T_PAD_ZERO);

Code Example 6-8. A user-defined 24-bit floating point datatype

 

Dtypes_fig9.JPG

Figure 6-9. A user-defined floating point datatype

 

 

From: Hdf-forum [mailto:[hidden email]] On Behalf Of Nelson, Jarom
Sent: Thursday, March 16, 2017 1:38 PM
To: HDF Users Discussion List <[hidden email]>
Subject: Re: [Hdf-forum] High precision floats

 

The forum history is searchable on nabble:

http://hdf-forum.184993.n3.nabble.com/

 

 

From: Hdf-forum [[hidden email]] On Behalf Of Martin Shetty
Sent: Wednesday, March 15, 2017 4:55 PM
To: [hidden email]
Subject: [Hdf-forum] High precision floats

 

I see from documentation that you can define custom floating types. Are there any examples out there for how to do this with GMP or MPFR? Or perhaps even more conveniently with boost/multiprecision?
http://www.boost.org/doc/libs/1_63_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats.html
Would (should?) hdfview also be able to understand these types? It sees 'long double' as opaque, but this one is not truly multiplatform so it is not of as much interest anyway.

P.S. Is there any way to search the HDF mailing list's archive other than downloading the gzips and grepping them? ;) I don't see any search capability on the website.


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Loading...