Hi, I found today that ISHFTing bits to the right does not give the right answer when the first argument is a PARAMETER, as per the following program:
program test_ishft implicit none integer, parameter :: n_par=20 integer :: n=20 integer :: n_double,n_half n_double=ishft(n,1) n_half=ishft(n,-1) print *,n_double,n_half ! correct: prints 40 and 10 n_double=ishft(n_par,1) n_half=ishft(n_par,-1) print *,n_double,n_half ! error: prints 40 and 0 (!!) end program test_ishft
compilation gives no errors:
$ ftn95 test_ishift.f95 [FTN95/Win32 Ver. 8.10.0 Copyright (c) Silverfrost Ltd 1993-2017] Licensed to: Rudnei Dias da Cunha Organisation: UFRGS
NO ERRORS [<TEST_ISHFT> FTN95 v8.10.0]
but the results given are:
40 10
40 0
Also, this is the system I am working on: $ ftn95 /v
Silverfrost FTN95/Win32 Copyright (C) 1993-2017 Silverfrost Ltd
----------------------------------------------------------------
Version: 8.10.0
Built: Sat Feb 11 12:23:39 2017
Operating System: Windows NT CPU: Intel(R) Core(TM) i5-6400T CPU @ 2.20GHz Model 14 Step 3
CPU Features: MMX, SSE, SSE2, x86-64
Thanks for looking into it! Cheers Rudnei