bug-gawk
[Top][All Lists]
Advanced

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

Re: How to check if a field is a number (integer or float)?


From: Peng Yu
Subject: Re: How to check if a field is a number (integer or float)?
Date: Sun, 20 Jun 2021 16:11:19 -0500

On 6/20/21, arnold@skeeve.com <arnold@skeeve.com> wrote:
> Peng Yu <pengyu.ut@gmail.com> wrote:
>
>> > This is exactly correct. As you have been told many times: Read The
>> > Manual
>> > and then you will no longer need to ask questions here. This will save
>> > time for you, me and everyone else on this list.
>>
>> That is not correct. Reading the manual is not sufficient to ensure a
>> solution is 100% correct. There can be always corner cases that only
>> somebody who is familiar with the awk internal can be sure about.
>> Otherwise, there wouldn't be so many partially correct solutions
>> floating no the web.
>
> You're a big boy. Read the manual, try stuff out on your own, and
> figure out how things work.  And/or read the code yourself.
>
>> >> The best solution that I figured out is just `typeof(x) == "strnum"`||
>> >> typeof(x) == "number"` instead of using regex.
>> >
>> > That should work.
>>
>> See, if this is disagreed by the next reply.
>
> If you mean Andy's note, there's no contradiction in what he wrote
> and in the test for strnum or number.

I am not saying contradiction. But the answers are not the same.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]