Bonsoir,
Lorsque je veux convertir en LaTeX ceci :
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
F:= (n)->2^(2^n)+1 ;
F(0) ;
F(1) ;
F(2) ;
F(3) ;
facteurs_premiers(F(3)) ;
F(4) ;
facteurs_premiers(F(4)) ;
F(5) ;
facteurs_premiers(F(5)) ;
F(6) ;
evalf(F(6),10) ;
facteurs_premiers(F(6)) ;
F(7) ;
evalf(F(7),10) ;
facteurs_premiers(F(7)) ;
F(8) ;
evalf(F(8),10) ;
facteurs_premiers(F(8)) ;
F(9) ;
evalf(F(9),10) ;
F(10) ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XCas plante (sur Debian Lenny ou Windows XP) et le fichier obtenu est incomplet :
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Generated by xcas
\documentclass{article}
\usepackage{pst-plot,color}
\usepackage{graphicx}
\begin{document}
\noindent \framebox{1} {\tt "Nombres de FERMAT" } \\
\begin{equation} \label{eq:0}
\mathrm{Nombres de FERMAT}
\end{equation}
\noindent \framebox{2} {\tt F(n):=2{\tt\symbol{94}}(2{\tt\symbol{94}}n)+1 } \\
{\em // Parsing F\\
// Success compiling F\\
\/} \\
\begin{equation} \label{eq:1}
\parbox{12cm}{\tt (n)-{\tt\symbol{62}}2{\tt\symbol{94}}(2{\tt\symbol{94}}n)+1 }
\end{equation}
\noindent \framebox{3} {\tt F(0) } \\
\begin{equation} \label{eq:2}
3
\end{equation}
\noindent \framebox{4} {\tt F(1) } \\
\begin{equation} \label{eq:3}
5
\end{equation}
\noindent \framebox{5} {\tt F(2) } \\
\begin{equation} \label{eq:4}
17
\end{equation}
\noindent \framebox{6} {\tt F(3) } \\
\begin{equation} \label{eq:5}
257
\end{equation}
\noindent \framebox{7} {\tt facteurs\_premiers(F(3)) } \\
\begin{equation} \label{eq:6}
[257,1]
\end{equation}
\noindent \framebox{8} {\tt F(4) } \\
\begin{equation} \label{eq:7}
65537
\end{equation}
\noindent \framebox{9} {\tt facteurs\_premiers(F(4)) } \\
\begin{equation} \label{eq:8}
[65537,1]
\end{equation}
\noindent \framebox{10} {\tt F(5) } \\
\begin{equation} \label{eq:9}
4294967297
\end{equation}
\noindent \framebox{11} {\tt facteurs\_premiers(F(5)) } \\
\begin{equation} \label{eq:10}
[641,1,6700417,1]
\end{equation}
\noindent \framebox{12} {\tt F(6) } \\
\begin{equation} \label{eq:11}
18446744073709551617
\end{equation}
\noindent \framebox{13} {\tt evalf(F(6),10) } \\
\begin{equation} \label{eq:12}
18446744073699999744.000000
\end{equation}
\noindent \framebox{14} {\tt facteurs\_premiers(F(6)) } \\
\begin{equation} \label{eq:13}
[274177,1,67280421310721,1]
\end{equation}
\noindent \framebox{15} {\tt F(7) } \\
\begin{equation} \label{eq:14}
340282366920938463463374607431768211457
\end{equation}
\noindent \framebox{16} {\tt evalf(F(7),10) } \\
\begin{equation} \label{eq:15}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Quelqu'un peut-il m'expliquer pourquoi et comment y remédier.
Merci.
Conversion en LaTeX (bis)
Modérateur : xcasadmin
Re: Conversion en LaTeX (bis)
C'est la conversion en latex du nombre flottant avec l'exposant 38 qui pose problème, apparament j'utilise mal la fonction de la libc sprintf, je pensais que la conversion d'un réel en chaine ne dépassait jamais 32 caractères, apparamment si et ça provoque un crash. Je vais passer a une fonction plus sure (ou augmenter la taille possible). En attendant, utilisez floor(log10(evalf(...)) pour avoir le nombre de chiffres (j'imagine que c'est à ça que sert l'evalf)
Re: Conversion en LaTeX (bis)
Je vais suivre vos recommandations, merci.