[GAP Forum] log_a b in floating point arithmetic

Alexander Konovalov alexander.konovalov at gmail.com
Sun Dec 19 20:43:57 GMT 2010


Dear Ivo,

On 19 Dec 2010, at 19:05, hedtke wrote:

> Dear Forum,
> 
> is there a way to compute log_a b in floating point arithmetic in GAP?
> 
> In the Forum Archive I found two solutions, but they didn't work:
> 1) there is a function LOG_FLOAT, but when I used it, GAP crashed.

LOG_FLOAT is undocumented function (so it is not guaranteed to work
as such in future releases, but a hint could be seen from here:

gap> LOG_FLOAT;
function( float ) ... end

- its argument must be a float, e.g.

gap> a:=LOG_FLOAT(Float(8));
2.07944
gap> b:=LOG_FLOAT(Float(2)); 
0.693147
gap> c:=a/b;
3
gap> IsFloat(c);
true

Note that c is also a float. 

> 2) there was a file "decimal.g" on ftp.math.rwth-aachen.de which may do what I want, but the FTP server is not available.

This may be a problem with DNS rather than with the FTP server - 
it seems available for me now. Anyway, this is probably this code 
for GAP 3.4.4 mirrored in Aachen:
ftp://ftp.gap-system.org/pub/gap/gap-3.4.4/deposit/gap/decimal.g

For GAP 4, there is a package FUtil by Frank Lübeck, partially based
on decimal.g: 
http://www.mth.rwth-aachen.de/~Frank.Luebeck/gap/FUtil/index.html

Hope this helps,
Alexander


More information about the Forum mailing list