Search found 249 matches

by frisian
Mar 14, 2011 19:43
Forum: Sources, Examples, Tips and Tricks
Topic: GMP factorial
Replies: 2
Views: 1415

Nice but when you want speed you can use

mpz_fac_ui (mtz_t rop, unsigned long int op)
set rop to op!
by frisian
Jan 05, 2011 17:55
Forum: Beginners
Topic: HUGE Numbers
Replies: 28
Views: 3483

My version for solving the problem Data "37107287533902102798797998220837590246510135740250" Data "46376937677490009712648124896970078050417018260538" Data "74324986199524741059474233309513058123726617309629" Data "91942213363574161572522430563301811072406154908250...
by frisian
Dec 11, 2010 21:46
Forum: Beginners
Topic: real10 examples
Replies: 12
Views: 2675

Hi Srvaldez

Nice piece of code glad to see that you get the bugs out.
Personally I found them more a case of assembler code where the code was wrongly compiled due to the absent of the keyword Ptr.
Will give your code a try.

regards
by frisian
Dec 06, 2010 22:28
Forum: General
Topic: return of a incorrect answer (sometimes)
Replies: 10
Views: 1712

hi Richard Your suggestion to use a constant is indeed a better idea. But your little program compares a calculated value with a constant. If you do base10 = 1/log(10) and you compare base10 with 0.4342944819032518 you will find that they are equal. If there is one thing I learned from all this is t...
by frisian
Nov 30, 2010 22:11
Forum: Projects
Topic: FbEdit, new IDE for FreeBASIC written in FreeBASIC
Replies: 964
Views: 242295

Hi KetilO Here are some things I noticed while working white FBedit they are observations regarding the way FBedit handles things. The code tooltip in on it displayed to close on the line where I work on so when i type a underscore it disappears (it looks if I typed a space). On the bottom right of ...
by frisian
Nov 30, 2010 20:56
Forum: General
Topic: return of a incorrect answer (sometimes)
Replies: 10
Views: 1712

Hi Richard Nice double_2_bin routine had to settle for the one I wrote because other idea's did work. I knew there are pitfalls working with double's but it seems that the more I look at them , the more there are. Also I found out that FreeBasic treats 0.4342944819032518 as a constant so for FreeBas...
by frisian
Nov 26, 2010 18:56
Forum: General
Topic: return of a incorrect answer (sometimes)
Replies: 10
Views: 1712

hi MichaelW What do you mean by “correct result”? After reading your question I had a new look at my program and decided to make a new program. Made a discovery and realized I was wrong. But things a still weird so have a look at it and tell me whats happening here, it look likes a round off error. ...
by frisian
Nov 25, 2010 22:32
Forum: General
Topic: return of a incorrect answer (sometimes)
Replies: 10
Views: 1712

While waiting for a test program to finish i got an idea. Why not write my one log routine in asm using fpu instructions. solves the problem but leaves the question why are the returned results wrong ' log_fpu = log (base e), natural log = freebasic log function Function log_fpu(x As Double) As Doub...
by frisian
Nov 25, 2010 20:24
Forum: General
Topic: return of a incorrect answer (sometimes)
Replies: 10
Views: 1712

return of a incorrect answer (sometimes)

Some time ago I was working on a program using srvaldez quad.bi. Using the log function I got some wrong results back, could not find the error or the part where things started to go wrong. After some time I found out it was a part of quad.bi, it involves a #undef log so that the log function could ...
by frisian
Oct 21, 2010 20:19
Forum: Sources, Examples, Tips and Tricks
Topic: Quad Precision
Replies: 58
Views: 10940

Dodicat Is it possible that your version of FreeBasic causes the errors in the second listing. One of the most given advice on problems is get the latest drivers or software. When I run into problems I get the latest version of Freebasic. My current Freebasic version: FreeBASIC Compiler - Version 0....
by frisian
Oct 21, 2010 20:06
Forum: General
Topic: no bug feature perhaps ?
Replies: 2
Views: 1213

dodicat

thank you for your reply will look at your code when i have time
by frisian
Oct 19, 2010 20:06
Forum: General
Topic: no bug feature perhaps ?
Replies: 2
Views: 1213

no bug feature perhaps ?

When I was trying out QUAD from srvaldez I saw somethings I had to check out and found that the information in the chm file and on Wiki is some way incorrect and on a other part correct. A single can hold values smaller then +/-2.8E-38 but a normal single = +/-2.8E-45 will result in a math overflow....
by frisian
Oct 19, 2010 20:03
Forum: Sources, Examples, Tips and Tricks
Topic: Quad Precision
Replies: 58
Views: 10940

Srvaldez I noticed that multiplication did not give very correct answers particular when doubles where involved that where say greater than 1e15 . Strangely when you multiply two quad's the answer is correct. That is somewhat strange because longmul uses exactmul2. When you use exactmul2 to multiply...
by frisian
Oct 15, 2010 18:32
Forum: Sources, Examples, Tips and Tricks
Topic: Quad Precision
Replies: 58
Views: 10940

I will try to explain whats happening. Q is of type quad, I enter q ="9.999999999999999e100" follow by a print q.hi en q.lo to print both values. I get q.hi = 1e+101 q.lo = -7.704951326524537e+084 when having a close look to the value of q.hi the value is very close to 1e+101. But is seems...
by frisian
Oct 13, 2010 17:45
Forum: Sources, Examples, Tips and Tricks
Topic: Quad Precision
Replies: 58
Views: 10940

I found a solution for quad_string giving a wrong answer for some numbers. When a quad value is 9.999999999999999e100 the hi part contains the value 1e+101 and the lo part the value -7.704951326524537e+084. The hi part is used to obtain a exponent based on a log (base 10). Since the hi part is 1e+10...