Skip to content

sage.misc.functional.log(float(3)) raises an AttributeError #19444

@seblabbe

Description

@seblabbe

import_statements suggest to import log this way:

sage: import_statements('log')
# **Warning**: distinct objects with name 'log' in:
#   - sage.functions.log
#   - math
#   - sage.functions
#   - sage.misc.functional
from sage.misc.functional import log

While those works:

sage: math.log(float(3))
1.0986122886681098
sage: sage.functions.log.log(float(3))
1.0986122886681098

This one raises an AttributeError:

sage: sage.misc.functional.log(float(3))
Traceback (most recent call last):
...
AttributeError: 'sage.rings.real_double.RealDoubleElement' object has no attribute '_log_base'

A subquestion is why do we have two implementations of log?

CC: @tscrim @jdemeyer @jhpalmieri

Component: basic arithmetic

Author: Frédéric Chapoton

Branch/Commit: d2f7962

Reviewer: Sébastien Labbé

Issue created by migration from https://trac.sagemath.org/ticket/19444

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions