replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - shiftr and shiftl
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

shiftr and shiftl

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions
View previous topic :: View next topic  
Author Message
Kenneth_Smith



Joined: 18 May 2012
Posts: 753
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Thu Jan 02, 2025 3:39 pm    Post subject: shiftr and shiftl Reply with quote

Please consider adding shiftr and shiftl to the wish list.

I had to resort to adding a ftn95 specific module in order to compile and run a much larger program with ftn95

Thanks

Ken

Code:
winapp

module shift_ftn95_mod
implicit none
contains

  integer function shiftr(i,n)
  integer, intent(in) :: i, n
    shiftr = ishft(i,-n)   
  end function shiftr

  integer function shiftl(i,n)
  integer, intent(in) :: i, n
    shiftl = ishft(i,n)
  end function shiftl
 
end module shift_ftn95_mod

program int_div_mult_by_2
use iso_fortran_env
use shift_ftn95_mod    ! Required with FTN95
implicit none
integer i, j
write(*,'(a,/)') compiler_version()
i = 3                       ! i = 3, j = 2
j = 2
print*, i/j                 ! i/j   = 1
print*, ishft(i,-1)         ! i / 2 = 1
print*, shiftr(i,1)         ! i / 2 = 1
print*, i*j                 ! i x j = 6
print*, shiftl(i,1)         ! i x 2 = 6
i = 4
print*                      ! i = 4, j = 2
print*, i/j                 ! i/j   = 2
print*, ishft(i,-1)         ! i / 2 = 2
print*, shiftr(i,1)         ! i / 2 = 2
print*, i*j                 ! i x j = 8
print*, shiftl(i,1)         ! i x 2 = 8
end program int_div_mult_by_2


Code:
FTN95 v9.04.0

            1
            1
            1
            6
            6

            2
            2
            2
            8
            8
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8087
Location: Salford, UK

PostPosted: Fri Jan 03, 2025 9:12 am    Post subject: Reply with quote

Thanks Ken. I will add these to the task list.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8087
Location: Salford, UK

PostPosted: Tue Jan 07, 2025 4:00 pm    Post subject: Reply with quote

shiftl,shiftr and shifta have now been added for Win32 and x64.

These will be in the next release of FTN95 and the associated DLLs.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group