Search found 231 matches

by frisian
Sep 14, 2017 20:14
Forum: Tips and Tricks
Topic: Bresenham3D
Replies: 3
Views: 186

Re: Bresenham3D

BasicCoder2 Your program contains for i as integer = 0 to l that should be for i = 0 to l . The i in for i as integer = 0 to l is a different one then the one in dim as integer i . Here is a other Bresenham in 3D that is much simpler. You should have a look there, it's a simple clear page with simpl...
by frisian
Sep 12, 2017 16:02
Forum: General
Topic: Sha-256 QB
Replies: 15
Views: 390

Re: Sha-256 QB

I don't have at this moment time to give a explanation of the changes I made but it should not be hard to spot them. The extra code makes the program slow but there is room for some speedup. 'SHA-256 OPTION EXPLICIT FUNCTION SHL&(x AS LONG, n) ' SHL& = x * 2 ^ n DIM x1 AS DOUBLE IF x < 0 THE...
by frisian
May 22, 2017 21:01
Forum: Tips and Tricks
Topic: Big Number Wrapper (GMP_INT.BI)
Replies: 3
Views: 451

Re: Big Number Wrapper (GMP_INT.BI)

srvaldez wrote:hello frisian, you need a constructor for the fp2 type.

Thanks for the code example, the only thing I knew that it needed a constructor through the error messages I got from my try's. But I had no idea how and where to put it.
by frisian
May 20, 2017 21:20
Forum: Beginners
Topic: Always for me a Big question
Replies: 28
Views: 1223

Re: Always for me a Big question

srvaldez wrote:thank you frisian for the update, perhaps you should post it in the tips & tricks section?

I have updated my GMP_INT.BI version in the tips and tricks section.
http://www.freebasic.net/forum/viewtopic.php?f=7&t=25684
by frisian
May 18, 2017 20:33
Forum: Tips and Tricks
Topic: Big Number Wrapper (GMP_INT.BI)
Replies: 3
Views: 451

Big Number Wrapper (GMP_INT.BI)

updated the GMP_INT.BI code (22 may 2017). (typo's, removed some redundant comments). updated Cipolla.bas to work with the Type code that srvaldez provided. updated the GMP_INT.BI code and added fdiv_cdiv.bas (20 may 2017). I extended Yetifoot's Big number wrapper with lots of new stuff making worki...
by frisian
May 06, 2017 9:09
Forum: Beginners
Topic: Always for me a Big question
Replies: 28
Views: 1223

Re: Always for me a Big question

[edit] in the test code, next to last line you missed a right parenthesis i = gmp_int(string(128,"1", 2) should be i = gmp_int(string(128,"1"), 2) also you missed a print i fixed the code in my previous post, thanks. I have cleaned the listing of gmp_int.bi and added shl and shr...
by frisian
May 05, 2017 21:12
Forum: Beginners
Topic: Always for me a Big question
Replies: 28
Views: 1223

Re: Always for me a Big question

Gmp_int.bi has two problems in the floating point division (/) routine. First the gmp floats need a 16 byte structure (__mpf_struct) but they get a 12 byte structure (__mpz_struct) which result in data stored outside the structure and most likely overwriting data in the next structure, hence crashes...
by frisian
Jan 12, 2017 21:07
Forum: Projects
Topic: Calendar Calculations Class
Replies: 4
Views: 447

Re: Calendar Calculations Class

rpkelly Had a look at your code, nice piece work. At the end of the file you have a function for ceiling a floating point. My suggestion is to replace Function = cmFloor(x * -1) * -1 with Function = -cmFloor(-x) . This will replace two multiplications with two sign change instructions. ' ===========...
by frisian
Dec 29, 2016 21:48
Forum: Beginners
Topic: How to convert from PowerBasic
Replies: 10
Views: 645

Re: How to convert from PowerBasic

If you search the internet then it's possible to find the code snippet. https://discuss.codechef.com/questions/7349/computing-factorials-of-a-huge-number-in-cc-a-tutorial #include<stdio.h> int main() { int t; int a[200]; //array will have the capacity to store 200 digits. int n,i,j,temp,m,x; scanf(&...
by frisian
Dec 28, 2016 13:37
Forum: Beginners
Topic: How to convert from PowerBasic
Replies: 10
Views: 645

Re: How to convert from PowerBasic

Working Dim As Integer a(2000), index, i, j, n, tmp, carry Input "Enter factorial: ";n a(0)=1 For j=n To 2 Step -1 carry = 0 For i = 0 To index tmp = (a(i) * j) + carry a(i) = tmp Mod 10 carry = tmp \ 10 Next i While carry > 0 index = index + 1 a(index) = carry Mod 10 carry = carry \ 10 We...
by frisian
Dec 18, 2016 9:47
Forum: General
Topic: gmp 6.1.2 and mpfr 3.1.5
Replies: 16
Views: 1710

Re: gmp 6.1.1 and mpfr 3.1.5

srvaldez wrote:hello frisian and integer
links updated

Thanks
by frisian
Dec 16, 2016 15:54
Forum: General
Topic: new header file GMP
Replies: 36
Views: 3907

Re: new header file GMP

I have corrected two memory leaks in the Greater and Equals routine's. And added detection for floats being used in the integer _div and _mod routine's. Also added output trim for the divide and sqrroot routine's ' 1 December 2016 - original by dodicat ' 11 December 2016 - frisian, added mpf_clear/m...
by frisian
Dec 16, 2016 10:16
Forum: General
Topic: new header file GMP
Replies: 36
Views: 3907

Re: new header file GMP

However, when I tried to calculate "70,000,005,000,000,007", this program was terminated abnormally when 15 million times repeated the loop . If any corresponding method is thought about, please teach me it. Toke me some time to realize that there are two division routines one for integer...
by frisian
Dec 11, 2016 20:18
Forum: General
Topic: new header file GMP
Replies: 36
Views: 3907

Re: new header file GMP

I don't know if dodicat is working on his program, but I post my version of his program with some alterations. I still had the one I had done some time ago so it wasn't that hard. I have not commenting every things. ' 1 December 2016 - orinal by dodicat ' 11 December 2016 - frisian, added mpf_clear/...
by frisian
Dec 11, 2016 19:51
Forum: General
Topic: gmp 6.1.2 and mpfr 3.1.5
Replies: 16
Views: 1710

Re: gmp 6.1.1 and mpfr 3.1.5

@srvaldez Both links (GMP/MPRF) do not work, in both cases I get Invalid or Deleted File. The key you provided for file access was invalid. This is usually caused because the file is no longer stored on MediaFire. This occurs when the file is removed by the originating user or MediaFire. Still have ...

Go to advanced search