SalehKiswani
IS-IT--Management
- Jul 16, 2011
- 60
Hello everybody,
I have a problem of calculating and displaying big numbers
this simple code will explain the idea:
!=================================================================
!-- Direct calculation--
stop(10239421*8*512) ! gives wrong answer (negative)
!-----------------------------------------
!--define n as Long--
n=10239421*8*512
stop ! gives wrong answer (negative)
!-----------------------------------------
!--define n1 as Decimal--
n1=10239421*8*512
stop(n1) ! gives wrong answer (negative)
!-----------------------------------------
! I tried to do the operation in two steps
n1=10239421*8
n1=n1*512
stop(n1) ! gives correct answer
(which is not applicable all time)
!-----------------------------------------
I faced this problem when I tried to use DIRECTORY function to get a list of file, so the file sizes which is so big give a result of nigative value
Any notes is appreciated
I have a problem of calculating and displaying big numbers
this simple code will explain the idea:
!=================================================================
!-- Direct calculation--
stop(10239421*8*512) ! gives wrong answer (negative)
!-----------------------------------------
!--define n as Long--
n=10239421*8*512
stop ! gives wrong answer (negative)
!-----------------------------------------
!--define n1 as Decimal--
n1=10239421*8*512
stop(n1) ! gives wrong answer (negative)
!-----------------------------------------
! I tried to do the operation in two steps
n1=10239421*8
n1=n1*512
stop(n1) ! gives correct answer
(which is not applicable all time)
!-----------------------------------------
I faced this problem when I tried to use DIRECTORY function to get a list of file, so the file sizes which is so big give a result of nigative value
Any notes is appreciated