473,396 Members | 1,895 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,396 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 6920
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.