[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Is -M enabled by default?
From: |
Peng Yu |
Subject: |
Re: [bug-gawk] Is -M enabled by default? |
Date: |
Mon, 12 Feb 2018 17:55:38 -0600 |
> gawk -e 'BEGIN{ x = 1; for(i=1;i<1000;++i) { x = x * 2; printf("%4d %.3e\n",
> i, x)} }'
The above code does not prove x is stored as double, because even if x
is stored as an arbitrary precision integer, it still can be converted
to double and printed with %e. Is there a way to print the underlying
type of a variable in awk. Thanks.
> All of those numbers are exactly representable in awk's default of C
> type double, which on modern machines in a 64-bit binary (base-2)
> format with a range of about 2.22E-308 to 1.79e+308.
--
Regards,
Peng
Re: [bug-gawk] Is -M enabled by default?, arnold, 2018/02/13