Nice but when you want speed you can use
mpz_fac_ui (mtz_t rop, unsigned long int op)
set rop to op!
Search found 249 matches
- Mar 14, 2011 19:43
- Forum: Sources, Examples, Tips and Tricks
- Topic: GMP factorial
- Replies: 2
- Views: 1415
- Jan 05, 2011 17:55
- Forum: Beginners
- Topic: HUGE Numbers
- Replies: 28
- Views: 3483
- Dec 11, 2010 21:46
- Forum: Beginners
- Topic: real10 examples
- Replies: 12
- Views: 2675
- 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...
- 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 ...
- 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...
- 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. ...
- 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...
- 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 ...
- 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....
- Oct 21, 2010 20:06
- Forum: General
- Topic: no bug feature perhaps ?
- Replies: 2
- Views: 1213
- 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....
- 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...
- Oct 15, 2010 18:32
- Forum: Sources, Examples, Tips and Tricks
- Topic: Quad Precision
- Replies: 58
- Views: 10940
- 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...