Future support for inttypes.h values

Stephen Torri storri at cse.wustl.edu
Mon Apr 26 04:30:02 CEST 2004


On Sun, 2004-04-25 at 20:27, Kevin Ryde wrote:
> Stephen Torri <storri at cse.wustl.edu> writes:
> >
> > I was wondering what the
> > future support was for this? What would the level of difficulty be for
> > adding this (e.g. easy, medium, hard)?
> 
> Notes from doc/tasks.html below.  I think supporting long long on gcc,
> and worrying about other compilers later would be a good option, it
> helps free software and doesn't hurt portability.
> 
> Since you can always use mpz_import and mpz_export, there's nothing
> actually lost by not having long long etc functions though.

Sounds like I can read in my uint64_t to a mpz_t doing the following:

uint64_t input_val; // Read from binary file
mpz_t input_obj;
mpz_import (input_obj, 1, 1, sizeof(uint64_t), 0, 0, (void*)&input_val)
mpz_class converted_input (input_obj);
class->variable = converted_input;  // Class variable is a mpf_class
type

The following maybe a hack but would you lose information doing:

uint64_t input_val; // Read from binary file
double input_obj = input_val;
class->variable = converted_input;

Stephen
-- 
Stephen Torri <storri at cse.wustl.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /list-archives/gmp-devel/attachments/20040425/eef2b5e3/attachment.bin


More information about the gmp-devel mailing list