[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] round




If you declare the  #i  variable to be an integer, it should work.  Here is
some test code I ran:
!************************************
begin-setup
   declare-variable
        integer #num_value
   end-declare
end-setup

begin-program

let #num_value = 8 / 7
show '8 / 7  =  ' #num_value

let #num_value = 7 / 7
show '7 / 7  =  ' #num_value

let #num_value = 6 / 7
show '6 / 7  =  ' #num_value

end-program
!************************************

The results were:

8 / 7  =  1
7 / 7  =  1
6 / 7  =  0

SQR: End of Run.




                                                                                
                            
                      "Ben Anderson"                                            
                            
                      <pegandersonbd1@h        To:       sqr-users@sqrug.org    
                            
                      otmail.com>              cc:                              
                            
                      Sent by:                 Subject:  [sqr-users] round      
                            
                      sqr-users-admin@s                                         
                            
                      qrug.org                                                  
                            
                                                                                
                            
                                                                                
                            
                      04/08/2003 10:57                                          
                            
                      AM                                                        
                            
                      Please respond to                                         
                            
                      sqr-users                                                 
                            
                                                                                
                            
                                                                                
                            




I want to either do integer divide or round:

let #i = 8/7  !I want this to be 1
let #i = 7/7  !I want this to be 1
let #i = 6/7  !I want this to be 0

I've been getting the decimal values and I want the integer.  If I need to
put steps in between, that's fine.
Thanks,
Ben Anderson

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users





_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users