compiled for win32/64 https://software.intel.com/content/www/ ... brary.html

this decimal math library includes the types decimal32, decimal64 and decimal128

the library includes the elementary transcendental functions like trig and exponential

also included is a rudimentary overload bi to make it easy to use, download from https://drive.google.com/file/d/19b1J7x ... sp=sharing

## Intel Decimal Floating-Point Math Library

### Intel Decimal Floating-Point Math Library

Last edited by srvaldez on Feb 26, 2021 12:06, edited 4 times in total.

### Re: Intel Decimal Floating-Point Math Library

Something seems to be wrong...

Code: Select all

`#include "libbid.bi"`

Using quad_dec

Dim As Decimal128 x

Print 4*Atn(1)

Print " 3.141592653589793238462643383279502884"

x=4*Atn(1)

Print x

x=2*Asin(1)

Print x

Print

Print " 1,4142135623730950488016887242097"

x=Sqr(2)

Print x

Sleep

### Re: Intel Decimal Floating-Point Math Library

My mistake, arguments must be of type Decimal128. Thank you.

Code: Select all

`#include "libbid.bi"`

Using quad_dec

Dim As Decimal128 x,i

Print 4*Atn(1)

Print 2*Asin(1)

Print 2*Acos(0)

Print Acos(-1)

Print " 3.141592653589793238462643383279502884"

i=1

x=4*Atn(i)

Print x

x=2*Asin(i)

Print x

i=0

x=2*Acos(i)

Print x

Print Acos(Decimal128(-1))

Print

Print Sqr(2)

Print " 1,414213562373095048801688724209698"

i=2

x=Sqr(i)

Print x

Print

Print x*x

Print x^2

Print Exp(2*Log(x))

Print Exp(Log(x)+Log(x))

Sleep

### Re: Intel Decimal Floating-Point Math Library

I polished up the bi, a bit closer to complete

one thing to keep in mind is that if you assign a double value to a decimal variable the value will most likely on be accurate to double precision

unless the double is an integer that fits in a double or it's an integer or fractional power of 2, for example 0.5 is ok but 0.1 is not but x="0.1" is ok

one thing to keep in mind is that if you assign a double value to a decimal variable the value will most likely on be accurate to double precision

unless the double is an integer that fits in a double or it's an integer or fractional power of 2, for example 0.5 is ok but 0.1 is not but x="0.1" is ok

### Re: Intel Decimal Floating-Point Math Library

fixed a copy/paste mistake in unary -

<edit> in retropect, instead of the Namespace quad_dec I should have used Namespace BID, in case one doesn't want to Using BID one can use the relatively short prefix BID

<edit> in retropect, instead of the Namespace quad_dec I should have used Namespace BID, in case one doesn't want to Using BID one can use the relatively short prefix BID

### Who is online

Users browsing this forum: No registered users and 5 guests