473,322 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

'half' floating point type

Hello,

Has anyone heard of the 'half' floating point type. That would be a
16bits floating point, see for example:

http://oss.sgi.com/projects/ogl-samp...loat_pixel.txt

Has anyone seen this type implemented in a C/C++ compiler ?

Thanks
-Mathieu
Ps: as far as I understand it could also be called 's10e5', or even
fp16...
Jun 27 '08 #1
4 6913
In article <24**********************************@m73g2000hsh. googlegroups.com>,
mathieu <ma***************@gmail.comwrote:
Has anyone heard of the 'half' floating point type. That would be a
16bits floating point, see for example:
I've -heard- of such things, long ago and far away, but I don't believe
I ever worked with them.

The surprisingly detailed list of historical floating point formats
at http://www.quadibloc.com/comp/cp0201.htm does not
reveal any 16 bit formats, except -possibly- the Stanford S-1 (the
wording is unclear in that regard.)
--
"The study of error is not only in the highest degree
prophylatic, but it serves as a stimulating introduction to the
study of truth." -- Walter Lipmann
Jun 27 '08 #2
"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.cawrote in message
news:fu**********@canopus.cc.umanitoba.ca...
In article
<24**********************************@m73g2000hsh. googlegroups.com>,
mathieu <ma***************@gmail.comwrote:
> Has anyone heard of the 'half' floating point type. That would be a
16bits floating point, see for example:

I've -heard- of such things, long ago and far away, but I don't believe
I ever worked with them.

The surprisingly detailed list of historical floating point formats
at http://www.quadibloc.com/comp/cp0201.htm does not
reveal any 16 bit formats, except -possibly- the Stanford S-1 (the
wording is unclear in that regard.)
Half float pixel is a hardware floating point option for OpenGL graphics
interfaces:
http://www.opengl.org/registry/specs...loat_pixel.txt

You inquire on the device with OpenGL to see if the interface is supported
(e.g. my Nvidia card supports it). The half float size has no value unless
there is hardware support for it, since float will be about the same speed
and packing and unpacking the little 16-bit buggers and doing your own
software math with them would defeat the whole purpose without hardware
support.
** Posted from http://www.teranews.com **
Jun 27 '08 #3
On Apr 22, 5:46*pm, "Dann Corbit" <dcor...@connx.comwrote:
*The half float size has no value unless
there is hardware support for it, since float will be about the same speed
and packing and unpacking the little 16-bit buggers and doing your own
software math with them would defeat the whole purpose without hardware
support.

Unless, of course, you have to store a whole lot of them, and you find
the precision and speed to size tradeoff to be worthwhile. And since
the OP didn't specify his performance requirements...

OTOH, in response to the OP's question, any such type would have to be
supported as an extension, it could not be one of the standard types.
In C++ you could create a half_float class easily enough, you’d need
to do little more than supply conversion operators.
Jun 27 '08 #4
mathieu wrote:
>
Has anyone heard of the 'half' floating point type. That would be
a 16bits floating point, see for example:

http://oss.sgi.com/projects/ogl-samp...loat_pixel.txt

Has anyone seen this type implemented in a C/C++ compiler ?

Ps: as far as I understand it could also be called 's10e5', or
even fp16...
I published such a system in Dr Dobbs Journal in 1979. See:

DDJ, March 1979, p.4 and April 1979, p.16

complete with full arithmetic functions, i.e. trig, exponential,
logs, etc. Written in assembly.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
31
by: JS | last post by:
We have the same floating point intensive C++ program that runs on Windows on Intel chip and on Sun Solaris on SPARC chips. The program reads the exactly the same input files on the two platforms....
5
by: Anton Noll | last post by:
We are using Visual Studio 2003.NET (C++) for the development of our software in the fields digital signal processing and numerical acoustics. One of our programs was working correctly if we are...
12
by: Dave Rahardja | last post by:
Does the C++ standard specify the behavior of floating point numbers during "exceptional" (exceptional with respect to floating point numbers, not exceptions) conditions? For example: double...
6
by: aegis | last post by:
how can I take the fractional part of a floating point value such that I can store that value into an integer type? float foo = 6.180; now take the fractional part such that you can store 180...
5
by: Steffen | last post by:
Hi, is it possible to have two fractions, which (mathematically) have the order a/b < c/d (a,b,c,d integers), but when (correctly) converted into floating point representation just have the...
15
by: michael.mcgarry | last post by:
Hi, I have a question about floating point precision in C. What is the minimum distinguishable difference between 2 floating point numbers? Does this differ for various computers? Is this...
4
by: jacob navia | last post by:
Hi people I continue to work in the tutorial for lcc-win32, and started to try to explain the floating point flags. Here is the relevant part of the tutorial. Since it is a difficult part, I...
102
by: tom fredriksen | last post by:
Hi I was doing a simple test of the speed of a "maths" operation and when I tested it I found that removing the loop that initialises the data array for the operation caused the whole program to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.