Recent

Author Topic: Small complex number dll's  (Read 1526 times)

BobDog

  • Full Member
  • ***
  • Posts: 141
Small complex number dll's
« on: August 28, 2021, 02:08:00 am »

32 and 64 bit dll's for basic complex numbers operations, and a small tester for each.
dll's written in freebasic using libmingwex.a which contains all the routines.

Bart

  • Hero Member
  • *****
  • Posts: 4475
    • Bart en Mariska's Webstek
Re: Small complex number dll's
« Reply #1 on: August 28, 2021, 11:37:45 am »
Is this better than the ucomplex unit that comes with fpc?

Bart

BobDog

  • Full Member
  • ***
  • Posts: 141
Re: Small complex number dll's
« Reply #2 on: August 28, 2021, 12:41:52 pm »

I don't know Bart.
I cannot get much info about the functions in ucomplex.
I can open the .o file with command nm from shell, but that's about it.
Have you some examples maybe?

PascalDragon

  • Hero Member
  • *****
  • Posts: 3406
  • Compiler Developer
Re: Small complex number dll's
« Reply #3 on: August 28, 2021, 02:17:52 pm »
I can open the .o file with command nm from shell, but that's about it.

Then for one reason or the other you don't have the sources installed. The unit can be found as packages/rtl-extra/src/inc/ucomplex.pp.

BobDog

  • Full Member
  • ***
  • Posts: 141
Re: Small complex number dll's
« Reply #4 on: August 28, 2021, 05:12:12 pm »

PascalDragon.
No, I don't use Lazarus, but thanks I can use ucomplex and now I see the operators and functions available from your link.
However, I quite like my own little dll's, but I would say that anyway
using ucomplex:
Code: Pascal  [Select][+][-]
  1. program tst;
  2. uses
  3. ucomplex;
  4. var
  5. pi,i,ans:complex;
  6.  
  7. begin
  8. pi:=4*carc_tg(cinit(1,0));
  9. i:=cinit(0,1);
  10. writeln('Eulers formula      -- e^(i*pi) + 1 =0');
  11. writeln('in ucomplex language-- cexp(i*pi)+cinit(1,0)');
  12. ans:=cexp(i*pi)+cinit(1,0);
  13.  
  14. writeln(single(ans.re),'  ',single(ans.im),'i');
  15. writeln('Press return to end . . .');
  16. readln;
  17. end.



 

TinyPortal © 2005-2018