Thread overview | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 19, 2012 add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
https://github.com/D-Programming-Language/phobos/pull/1018/files |
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 2012-12-19 08:30, Walter Bright wrote: > https://github.com/D-Programming-Language/phobos/pull/1018/files Cool, Walter does a pull request. Should this be put in the review queue or is this a small enough change to be added anyway? -- /Jacob Carlborg |
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 19-12-2012 08:35, Jacob Carlborg wrote: > On 2012-12-19 08:30, Walter Bright wrote: >> https://github.com/D-Programming-Language/phobos/pull/1018/files > > Cool, Walter does a pull request. Should this be put in the review queue > or is this a small enough change to be added anyway? > Seems a bit overkill to throw it in the review queue, but I don't know how rigorous we want to be about that. -- Alex Rønne Petersen alex@alexrp.com / alex@lycus.org http://lycus.org |
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alex Rønne Petersen | On 12/19/2012 12:47 AM, Alex Rønne Petersen wrote:
> On 19-12-2012 08:35, Jacob Carlborg wrote:
>> On 2012-12-19 08:30, Walter Bright wrote:
>>> https://github.com/D-Programming-Language/phobos/pull/1018/files
>>
>> Cool, Walter does a pull request. Should this be put in the review queue
>> or is this a small enough change to be added anyway?
>>
>
> Seems a bit overkill to throw it in the review queue, but I don't know how
> rigorous we want to be about that.
Probably the main point of this module is to demonstrate how to do new arithmetic types like this without needing compiler support. It also shows how to do IEEE floating point rounding correctly, which is not obvious and not trivial.
This particular type is a standard type and crops up in graphics code, so there is a use for it.
|
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright Attachments:
| On 19 December 2012 08:55, Walter Bright <newshound2@digitalmars.com> wrote: > On 12/19/2012 12:47 AM, Alex Rønne Petersen wrote: > >> On 19-12-2012 08:35, Jacob Carlborg wrote: >> >>> On 2012-12-19 08:30, Walter Bright wrote: >>> >>>> https://github.com/D-**Programming-Language/phobos/**pull/1018/files<https://github.com/D-Programming-Language/phobos/pull/1018/files> >>>> >>> >>> Cool, Walter does a pull request. Should this be put in the review queue or is this a small enough change to be added anyway? >>> >>> >> Seems a bit overkill to throw it in the review queue, but I don't know how rigorous we want to be about that. >> > > Probably the main point of this module is to demonstrate how to do new arithmetic types like this without needing compiler support. It also shows how to do IEEE floating point rounding correctly, which is not obvious and not trivial. > > How difficult would you think it would be to scale down (or up) this library type so it can be an emulated IEEE type of any size? (The whole shebang eg: quarter, half, single, double, quad, double-quad, 80bit and 96-bit). Just interested as I think that a module which implements an IEEE floating point type that produces constant results cross-platform would be better than a dedicated module just for half float types. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wednesday, 19 December 2012 at 07:30:54 UTC, Walter Bright wrote: > https://github.com/D-Programming-Language/phobos/pull/1018/files If that ever helps, I implemented this fast conversion ftp://www.fox-toolkit.org/pub/fasthalffloatconversion.pdf for a half wrapper here: https://github.com/p0nce/gfm/blob/master/math/half.d It's woefully untested though. In 3D graphics efficiently converting float to half can speed up vertex submission. |
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Attachments:
| On Wed, Dec 19, 2012 at 3:43 PM, Iain Buclaw <ibuclaw@ubuntu.com> wrote:
> How difficult would you think it would be to scale down (or up) this library type so it can be an emulated IEEE type of any size? (The whole shebang eg: quarter, half, single, double, quad, double-quad, 80bit and 96-bit). Just interested as I think that a module which implements an IEEE floating point type that produces constant results cross-platform would be better than a dedicated module just for half float types.
>
+1
|
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | On Wednesday, 19 December 2012 at 10:13:56 UTC, Iain Buclaw wrote:
> On 19 December 2012 08:55, Walter Bright <newshound2@digitalmars.com> wrote:
>
>> On 12/19/2012 12:47 AM, Alex Rønne Petersen wrote:
>>
>>> On 19-12-2012 08:35, Jacob Carlborg wrote:
>>>
>>>> On 2012-12-19 08:30, Walter Bright wrote:
>>>>
>>>>> https://github.com/D-**Programming-Language/phobos/**pull/1018/files<https://github.com/D-Programming-Language/phobos/pull/1018/files>
>>>>>
>>>>
>>>> Cool, Walter does a pull request. Should this be put in the review queue
>>>> or is this a small enough change to be added anyway?
>>>>
>>>>
>>> Seems a bit overkill to throw it in the review queue, but I don't know how
>>> rigorous we want to be about that.
>>>
>>
>> Probably the main point of this module is to demonstrate how to do new
>> arithmetic types like this without needing compiler support. It also shows
>> how to do IEEE floating point rounding correctly, which is not obvious and
>> not trivial.
>>
>>
> How difficult would you think it would be to scale down (or up) this
> library type so it can be an emulated IEEE type of any size? (The whole
> shebang eg: quarter, half, single, double, quad, double-quad, 80bit and
> 96-bit). Just interested as I think that a module which implements an
> IEEE floating point type that produces constant results cross-platform
> would be better than a dedicated module just for half float types.
What is the difference between std.numeric.CustomFloat and this?
|
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to tn Attachments:
| On 19 December 2012 11:30, tn <no@email.com> wrote: > On Wednesday, 19 December 2012 at 10:13:56 UTC, Iain Buclaw wrote: > >> On 19 December 2012 08:55, Walter Bright <newshound2@digitalmars.com> wrote: >> >> On 12/19/2012 12:47 AM, Alex Rønne Petersen wrote: >>> >>> On 19-12-2012 08:35, Jacob Carlborg wrote: >>>> >>>> On 2012-12-19 08:30, Walter Bright wrote: >>>>> >>>>> https://github.com/D-****Programming-Language/phobos/**** >>>>>> pull/1018/files<https://github.com/D-**Programming-Language/phobos/**pull/1018/files> <https://**github.com/D-Programming-**Language/phobos/pull/1018/** files<https://github.com/D-Programming-Language/phobos/pull/1018/files> >>>>>> > >>>>>> >>>>>> >>>>> Cool, Walter does a pull request. Should this be put in the review >>>>> queue >>>>> or is this a small enough change to be added anyway? >>>>> >>>>> >>>>> Seems a bit overkill to throw it in the review queue, but I don't >>>> know how >>>> rigorous we want to be about that. >>>> >>>> >>> Probably the main point of this module is to demonstrate how to do new >>> arithmetic types like this without needing compiler support. It also >>> shows >>> how to do IEEE floating point rounding correctly, which is not obvious >>> and >>> not trivial. >>> >>> >>> How difficult would you think it would be to scale down (or up) this >> library type so it can be an emulated IEEE type of any size? (The whole shebang eg: quarter, half, single, double, quad, double-quad, 80bit and 96-bit). Just interested as I think that a module which implements an IEEE floating point type that produces constant results cross-platform would be better than a dedicated module just for half float types. >> > > What is the difference between std.numeric.CustomFloat and this? > With this, there's a choice of rounding modes, casting between float and integral types, and the fact that not many people know about it? -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
December 19, 2012 Re: add phobos module std.halffloat ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 12/19/12 2:30 AM, Walter Bright wrote:
> https://github.com/D-Programming-Language/phobos/pull/1018/files
Shouldn't it be part of std.numeric?
Related, we should have a decision point "this must go through the review process" vs. "the pull review process is sufficient". New modules definitely must go through the review process, as should large additions to existing models.
Andrei
|
Copyright © 1999-2021 by the D Language Foundation