- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Is there integer limit in HP-UX ksh?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2006 08:22 PM
тАО08-14-2006 08:22 PM
Is there integer limit in HP-UX ksh?
$ (( i = 4190246798 + 4190246798 ))
$ echo $i
-209440996
Please ksh expert explain the reason.
BTW, I try the same example in Solaris, Solaris ksh can give correct result. Please try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2006 08:28 PM
тАО08-14-2006 08:28 PM
Re: Is there integer limit in HP-UX ksh?
I'm not sure if a typeset -i declaration can cope, but man ksh should tell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2006 08:38 PM
тАО08-14-2006 08:38 PM
Re: Is there integer limit in HP-UX ksh?
the posix shell only supports 32 bits integers, i.e. max 2147483648
Try Ralph's suggestion, e.g.:
# echo "4190246798 + 4190246798" | bc
8380493596
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2006 08:38 PM
тАО08-14-2006 08:38 PM
Re: Is there integer limit in HP-UX ksh?
looks like 2^31 is the limit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2006 01:57 AM
тАО08-15-2006 01:57 AM
Re: Is there integer limit in HP-UX ksh?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2006 08:41 PM
тАО08-16-2006 08:41 PM
Re: Is there integer limit in HP-UX ksh?
if you are happy with the solutions given, can you please reward good answers, see
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
and close the thread.