How to use math functions in dcompute?

naetherm naether.markus at gmail.com
Sun Feb 24 13:00:14 UTC 2019


On Tuesday, 25 September 2018 at 05:18:55 UTC, Sobaya wrote:
> On Thursday, 20 September 2018 at 12:48:14 UTC, Nicholas Wilson 
> wrote:
>> On Thursday, 20 September 2018 at 12:43:02 UTC, Nicholas 
>> Wilson wrote:
>>> Hmm, I can reproduce. Will look into it.
>>
>> pragma(LDC_intrinsic, "llvm.nvvm.cos.approx.f")
>> float cos(float val);
>>
>> does work but is an approximation.
>
> It works for me.
>
> I'll use it currently.
>
> Thanks!

FYI: Using
pragma(LDC_intrinsic, "llvm.nvvm.cos.f#") // note the # in place 
of 32
T cos(T)(T val) if (__traits(isFloating, T));

seems to work now.


More information about the Digitalmars-d-learn mailing list