Math primitives on larger .net num representations. INT64...

Using (or providing) Microsoft.NET Classes

Math primitives on larger .net num representations. INT64...

Postby norbertjurkiewicz84 on Thu Jul 27, 2017 1:27 pm

User avatar
norbertjurkiewicz84
 
Posts: 48
Joined: Mon Nov 01, 2010 7:26 pm

Re: Math primitives on larger .net num representations. INT6

Postby JohnD|Dyalog on Fri Jul 28, 2017 8:31 am

Int64s and UInt64s are returned as objects (aka namespaces) to the interpreter. To convert these to DECFs on which (if ⎕FR is set to 1287), Dyalog can perform arithmetic, I'd recommend something like:

Convert.ToDecimal val

This will work on all sort of "types" of val:

Convert.ToDecimal⊂'23424234'

Note, that if you don't need the extra precision that DECFs give you over doubles (which only offer 53 bits of integer precision), you can Convert.ToDouble, and leave DR at 645.

Note also, that technically we could auto-convert all incoming Int64 and UInt64s to DECFs but that would be a breaking change from pre-DECF versions of the interpreter so we decided not to do that.
User avatar
JohnD|Dyalog
 
Posts: 60
Joined: Wed Oct 01, 2008 9:35 am


Return to Microsoft.NET

Who is online

Users browsing this forum: No registered users and 3 guests