Skip to content

Commit

Permalink
Add toggle to raw for full precision for long Rs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlowryduda committed May 24, 2024
1 parent fa2eb99 commit 634d8fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lmfdb/maass_forms/templates/maass_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h2>{{ KNOWL('mf.maass.mwf', 'Maass form') }} invariants</h2>
{% endif %}
<tr>
<td> {{ KNOWL('mf.maass.mwf.spectralparameter', title='Spectral parameter') }}: </td>
<td>\( {{ mf.spectral_parameter }} \pm {{ mf.web_spectral_error }} \)</td>
<td> {{ mf.web_spectral_line | safe }} </td>
</tr>
</table>

Expand Down
20 changes: 19 additions & 1 deletion lmfdb/maass_forms/web_maassform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
from lmfdb import db
from lmfdb.utils import display_knowl, Downloader, web_latex_factored_integer, prop_int_pretty
from lmfdb.utils import (
display_knowl,
Downloader,
prop_int_pretty,
raw_typeset,
web_latex_factored_integer,
)
from psycodict.encoding import Json
from flask import url_for, abort
from sage.all import RR, ZZ, factor, sign, prod
Expand Down Expand Up @@ -170,6 +176,18 @@ def web_spectral_error(self):
exponent = str(int(exponent))
return rf"{base} \cdot 10^{{{exponent}}}"

@property
def web_spectral_line(self):
if len(str(self.spectral_parameter)) < 35:
return rf"\({self.spectral_parameter} \pm {self.web_spectral_error}\)"
else:
short_spectral = str(self.spectral_parameter)[:35]
return raw_typeset(
str(self.spectral_parameter) + " +- " + str(self.spectral_error),
rf"\( {short_spectral}\ldots \pm {self.web_spectral_error} \)",
extra="(toggle for full precision)"
)

@property
def title(self):
digits_to_show = 10
Expand Down

0 comments on commit 634d8fd

Please sign in to comment.