Am 02.05.2024 um 05:30 schrieb Robert Elz: > Module Name: src > Committed By: kre > Date: Thu May 2 03:30:07 UTC 2024 > > Modified Files: > src/tests/lib/libm: t_fe_round.c > > Log Message: > Use intmax_t instead of long int when trying to represent very large > integers (10^50 or so), so we don't exceed the capacity of systems where > long int is only 32 bits.
In the lint tests (which don't have a C preprocessor available), I use the following typedefs to get fixed-width integer types: typedef signed char int8_t; typedef short int16_t; typedef int int32_t; typedef long long int64_t; These types are the same on all platforms supported by lint, and I guess by NetBSD as a whole. I particularly avoid the types 'long' and 'long double', as they vary between the platforms. Curiously, intmax_t is a 64-bit type even on amd64, where __int128_t is also available, but I don't use that because that type is not predefined. Roland