add phobos module std.halffloat ?
Iain Buclaw
ibuclaw at ubuntu.com
Wed Dec 19 03:47:38 PST 2012
On 19 December 2012 11:30, tn <no at 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 at 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';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121219/741fa1e3/attachment.html>
More information about the Digitalmars-d
mailing list