|
Home > Archive > Unix questions > March 2005 > How does UNIX store numeric data
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How does UNIX store numeric data
|
|
| Ken Applequist 2005-03-04, 5:58 pm |
| I've heard that all data, whether the intent is for the data to be numeric
or character, is stored in character format. Is this true? If so, does the
following command change the way the data is actually stored?
typeset -i number
Thanks,
Ken
| |
| William Park 2005-03-05, 5:57 pm |
| Ken Applequist <apple07840@yahoo.com> wrote:
> I've heard that all data, whether the intent is for the data to be numeric
> or character, is stored in character format. Is this true? If so, does the
> following command change the way the data is actually stored?
>
> typeset -i number
No.
--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
Slackware Linux -- because it works.
| |
| Ken Applequist 2005-03-05, 5:57 pm |
| Then what's the point to the typset -i command?
I would have assumed that this command would store data in binary in order
to avoid converting from character to binary. If a variable has to be
converted every time it's interpreted any way, what's the point to using the
typset -i command?
"William Park" <opengeometry@yahoo.ca> wrote in message
news:B9oWd.551$pp6.311@fe51.usenetserver.com...
> Ken Applequist <apple07840@yahoo.com> wrote:
>
> No.
>
> --
> William Park <opengeometry@yahoo.ca>, Toronto, Canada
> Slackware Linux -- because it works.
>
| |
| William Park 2005-03-06, 2:48 am |
| Ken Applequist <apple07840@yahoo.com> wrote:
> Then what's the point to the typset -i command?
>
> I would have assumed that this command would store data in binary in
> order to avoid converting from character to binary. If a variable has
> to be converted every time it's interpreted any way, what's the point
> to using the typset -i command?
There is only one data type in shell, ie. text or string. It's stored
as string. 'typeset -i' or 'declare -i' will make difference when you
are assigning to the variable, not when you are reading from the
variable.
Eg.
declare -i a
a=0
a=000
--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
Slackware Linux -- because it works.
|
|
|
|
|