How does UNIX store numeric data
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > How does UNIX store numeric data




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How does UNIX store numeric data  
Ken Applequist


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-04-05 10: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









[ Post a follow-up to this message ]



    Re: How does UNIX store numeric data  
William Park


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-05-05 10: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.






[ Post a follow-up to this message ]



    Re: How does UNIX store numeric data  
Ken Applequist


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-05-05 10: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.
>







[ Post a follow-up to this message ]



    Re: How does UNIX store numeric data  
William Park


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-06-05 07: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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:00 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register