Skip to content

doctest fix for: cot(float) returns complex #21365

@paulmasson

Description

@paulmasson
sage: cot(float(.1))
(9.966644423259224+0j)

This causes a plot of cot() on the real axis to fail. Sample output:

sage: set_verbose(1)
sage: plot(cot(x),(x,.1,.5),plot_points=5)
verbose 1 (3743: plot.py, generate_plot_points) can't convert complex to float
Unable to compute f(0.1) (time = 1.604825)
verbose 1 (3743: plot.py, generate_plot_points) can't convert complex to float
Unable to compute f(0.199629500548) (time = 1.615858)
verbose 1 (3743: plot.py, generate_plot_points) can't convert complex to float
Unable to compute f(0.263010079144) (time = 1.616164)
verbose 1 (3743: plot.py, generate_plot_points) can't convert complex to float
Unable to compute f(0.373209060982) (time = 1.616497)
verbose 1 (3743: plot.py, generate_plot_points) can't convert complex to float
Unable to compute f(0.5) (time = 1.616673)
verbose 0 (3743: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 5 points.
verbose 0 (3743: plot.py, generate_plot_points) Last error message: 'can't convert complex to float'
Launched png viewer for Graphics object consisting of 0 graphics primitives

There is no problem plotting 1/tan().

Component: symbolics

Author: Ralf Stephan

Branch/Commit: c0ef7a5

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions