[CLN-list] integer conversion functions weirdness

Sheplyakov Alexei varg at theor.jinr.ru
Wed Oct 18 13:15:37 CEST 2006


Hello!

Functions for conversion from cl_I into built-in integer types
are a little bit weird: if conversion fails, CLN just aborts the program.
This weirdness is documented in the manual:

\begin{quote}
`int cl_I_to_int (const cl_I& x)'
`unsigned int cl_I_to_uint (const cl_I& x)'
`long cl_I_to_long (const cl_I& x)'
`unsigned long cl_I_to_ulong (const cl_I& x)'
Returns `x' as element of the C type CTYPE. If `x' is not
representable in the range of CTYPE, a runtime error occurs.
\end{quote}

So my question is: how do I check if the variable of cl_I type can be
converted to int (or any other built-in integer type[s])?

Best regards,
 Alexei.

-- 
All science is either physics or stamp collecting.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/cln-list/attachments/20061018/7aadf85b/attachment.pgp


More information about the CLN-list mailing list