Denis Simon on Thu, 06 Jul 2023 23:02:28 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to do t_INT bit operations?


Hi Ruud,

These commands do not do exactly the same.
In particular, 
print(Str(gettime())ms);
print(Str(gettime()ms));
print(gettime()ms);

These three use the value of the variable called ms.
If this variable has not be assigned a value, it prints its name, hence "ms".
But if it has a value, the value is printed.
For example:

? ms="hello world"; print(Str(gettime())ms);
1hello world

So these three options should definitely not be used.

Denis SIMON.




----- Mail original -----
> De: "Ruud H.G. van Tol" <rvtol@isolution.nl>
> À: "pari-users" <pari-users@pari.math.u-bordeaux.fr>
> Envoyé: Jeudi 6 Juillet 2023 09:56:52
> Objet: Re: How to do t_INT bit operations?

> On 2023-07-06 09:14, hermann@stamm-wilbrandt.de wrote:
> 
>> print(Str(gettime())"ms");
> 
> Just to nitpick:
> 
> Str() can be used as a string-concatter,
> but print() already does that itself.
> 
> AFAIK, these do about all the same:
> 
> print(Str(gettime())"ms");
> print(Str(gettime())ms);
> print(Str(gettime()),"ms");
> print(Str(gettime(),"ms"));
> print(Str(gettime()ms));
> print(gettime()ms);
> print(gettime(), "ms");
> 
> And I would always use the last one.
> 
> 
> I hardly ever use gettime(), I prefer to use
> stored getabstime() values, with printf.
> 
> -- Ruud