> Le 30 oct. 2023 à 02:39, Oleg Nesterov <o...@redhat.com> a écrit : > > On 10/30, Dario Sanfilippo wrote: >> >>>> In >>>> that case; functions such as ba.time would also get an improvement. >>> >>> Why do you think so?? >>> >>> perhaps you meant that ba.time can overflow? Yes it can, but I don't >>> think this should depend on -double. > > So what exactly did you mean? > >> From what I understand, a double can represent correctly a larger range of >> ints than an int32_t can, so if Faust assumed all signals to be float when >> using -double, we would avoid the issues above. > > but we will have other issues, > >> Other than it shouldn't be determined by the -double flag, do we agree that >> dealing with ints using double would be better than using int32_t? > > Sorry, no, I think this is a horrible idea :/ > > faust has types. Very limited set. You suggest to remove kInt. This looks > strange to me, to say at least. > > Oleg. >
I agree with Oleg here: - Integers in Faust are 32-bits integer with all their « properties », which are currently used in the library no.noise generator using the wrapping behaviour (maybe not the best idea we had, but well…) - math operations on integers stay in the Integer domain in general. The / (division) only promotes both arguments as float as does a float division. - some other primitive do « type promotion ». This has been better documented here : https://faustdoc.grame.fr/manual/syntax, with something like « automatically promoted to int » at several places - we can not afford to change the behaviour of integers in -double mode as Dario suggested, since it would instantly break existing code in a « blind » manner. - do we need an *explicit new option* to set the integer size (like -int32, -in64 or better possibly -int N, with N = 32, 64, 128 one day ?), so as a *user choice* ? But that 1) would break no.noise implementation, so we would need to write alterable version… 2) this could blindly break existing code…. Comments ? Stéphane _______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users