'b' character at the end of inter in Cray fortran

  • Follow


Dear users,

Now I'm compiling program written in CRAY.
There is weird thing.
ndash is integer type.
What is following???????


  ndash = 1777b


Thanks in advance.

TN
0
Reply esillica (1) 3/28/2011 5:24:32 AM

"tolasma" <esillica@gmail.com> wrote in message 
news:2a0a7cca-f857-488e-97ee-c79cea94dcfe@o21g2000prh.googlegroups.com...

> Now I'm compiling program written in CRAY.
> There is weird thing.
> ndash is integer type.
> What is following???????

>  ndash = 1777b

1023

Translate to

ndash = int(o'1777')

-- 
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


0
Reply James 3/28/2011 5:41:57 AM


Thank you very much.
And There are more weird.

       DATA MSK    /777777777777777777777B/
       DATA SIGNBIT/1000000000000000000000B/

When I compile that as following

          ndash =3Dint(o'777777777777777777777')

I've got following message.
[gkrun@hydra2 temp]$ g77 -o octal octalt.f
octalt.f: In program `MAIN__':
octalt.f:2:
          ndash =3Dint(o'777777777777777777777')
                       ^
Integer at (^) too large

How can I solve this problem?

Thank you~

TN


On 3=EC=9B=9428=EC=9D=BC, =EC=98=A4=ED=9B=842=EC=8B=9C41=EB=B6=84, "James V=
an Buskirk" <not_va...@comcast.net> wrote:
> "tolasma" <esill...@gmail.com> wrote in message
>
> news:2a0a7cca-f857-488e-97ee-c79cea94dcfe@o21g2000prh.googlegroups.com...
>
> > Now I'm compiling program written in CRAY.
> > There is weird thing.
> > ndash is integer type.
> > What is following???????
> > =C2=A0ndash =3D 1777b
>
> 1023
>
> Translate to
>
> ndash =3D int(o'1777')
>
> --
> write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
> 6.0134700243160014d-154/),(/'x'/)); end

0
Reply tolasma 3/28/2011 5:50:25 AM

On Mar 28, 7:50=A0am, tolasma <esill...@gmail.com> wrote:
> Thank you very much.
> And There are more weird.
>
> =A0 =A0 =A0 =A0DATA MSK =A0 =A0/777777777777777777777B/
> =A0 =A0 =A0 =A0DATA SIGNBIT/1000000000000000000000B/
>
> When I compile that as following
>
> =A0 =A0 =A0 =A0 =A0 ndash =3Dint(o'777777777777777777777')
>
> I've got following message.
> [gkrun@hydra2 temp]$ g77 -o octal octalt.f
> octalt.f: In program `MAIN__':
> octalt.f:2:
> =A0 =A0 =A0 =A0 =A0 ndash =3Dint(o'777777777777777777777')
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0^
> Integer at (^) too large
>
> How can I solve this problem?
>
> - Show quoted text -
These two statements expect MSK and SIGNBIT to have a length of 64
bits.

Regards,

Mike Metcalf

0
Reply michaelmetcalf (810) 3/28/2011 6:50:01 AM

On 2011-03-28 02:50:25 -0300, tolasma said:

> Thank you very much.
> And There are more weird.
> 
>        DATA MSK    /777777777777777777777B/
>        DATA SIGNBIT/1000000000000000000000B/
> 
> When I compile that as following
> 
>           ndash =int(o'777777777777777777777')
> 
> I've got following message.
> [gkrun@hydra2 temp]$ g77 -o octal octalt.f
> octalt.f: In program `MAIN__':
> octalt.f:2:
>           ndash =int(o'777777777777777777777')
>                        ^
> Integer at (^) too large
> 
> How can I solve this problem?

20 "7"s at 3 bits each is 60 bits. Just like a Cray word.
Easiest solution is to use a Cray. :-) Otherwise you
are left with understanding what was intended. That means
knowing enough about both how a Cray worked and what you
problem needs. Both aspects are somewhere between awkward and
very awkward.

The trailing B means Binary which is really Octal in case
your recipe did not make sense to you. Why B for Octal remains
a mystery that only the original Cray folks can explain. Most
likely a case of choosing a name before they realized the possibility
of generalizations.

> Thank you~
> 
> TN
> 
> 
> On 3월28일, 오후2시41분, "James Van Buskirk" <not_va...@comcast.net> wrote:
>> "tolasma" <esill...@gmail.com> wrote in message
>> 
>> news:2a0a7cca-f857-488e-97ee-c79cea94dcfe@o21g2000prh.googlegroups.com...
>> 
>>> Now I'm compiling program written in CRAY.
>>> There is weird thing.
>>> ndash is integer type.
>>> What is following???????
>>>  ndash = 1777b
>> 
>> 1023
>> 
>> Translate to
>> 
>> ndash = int(o'1777')
>> 
>> --
>> write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
>> 6.0134700243160014d-154/),(/'x'/)); end


0
Reply Gordon 3/28/2011 12:36:07 PM

On Mar 28, 2:36=A0pm, Gordon Sande <Gordon.Sa...@gmail.com> wrote:
>
> 20 "7"s at 3 bits each is 60 bits.

But there are 21!

Regards,

Mike Metcalf
0
Reply m_b_metcalf 3/28/2011 12:40:48 PM

On 3/28/11 7:36 AM, Gordon Sande wrote:
> On 2011-03-28 02:50:25 -0300, tolasma said:
>
>> Thank you very much.
>> And There are more weird.
>>
>> DATA MSK /777777777777777777777B/
>> DATA SIGNBIT/1000000000000000000000B/
>>
>> When I compile that as following
>>
>> ndash =int(o'777777777777777777777')
>>
>> I've got following message.
>> [gkrun@hydra2 temp]$ g77 -o octal octalt.f
>> octalt.f: In program `MAIN__':
>> octalt.f:2:
>> ndash =int(o'777777777777777777777')
>> ^
>> Integer at (^) too large
>>
>> How can I solve this problem?
>
> 20 "7"s at 3 bits each is 60 bits. Just like a Cray word.

The Cray word was 64 bits long, it was CDC that had 60 bit words.

> Easiest solution is to use a Cray. :-) Otherwise you
> are left with understanding what was intended. That means
> knowing enough about both how a Cray worked and what you
> problem needs. Both aspects are somewhere between awkward and
> very awkward.
>
> The trailing B means Binary which is really Octal in case
> your recipe did not make sense to you. Why B for Octal remains
> a mystery that only the original Cray folks can explain. Most
> likely a case of choosing a name before they realized the possibility
> of generalizations.
>

It's not a mystery!  ;)  The Cray people chose "B" because that's what 
the CDC people choose and they were Cray's biggest competitor.  CDC 
probably choose "B" because it doesn't look like zero; "O" and "0" were 
tough to distinguish on old line printers ;).

Dick Hendrickson
0
Reply Dick 3/28/2011 2:50:36 PM

"Gordon Sande" <Gordon.Sande@gmail.com> wrote in message news:impvbn$5k5$1@dont-email.me...

| On 2011-03-28 02:50:25 -0300, tolasma said:
|
| > Thank you very much.
| > And There are more weird.
| >
| >        DATA MSK    /777777777777777777777B/
| >        DATA SIGNBIT/1000000000000000000000B/
| >
| > When I compile that as following
| >
| >           ndash =int(o'777777777777777777777')
| >
| > I've got following message.
| > [gkrun@hydra2 temp]$ g77 -o octal octalt.f
| > octalt.f: In program `MAIN__':
| > octalt.f:2:
| >           ndash =int(o'777777777777777777777')
| >                        ^
| > Integer at (^) too large
| >
| > How can I solve this problem?
|
| 20 "7"s at 3 bits each is 60 bits. Just like a Cray word.

There are 21 digits = 63 bits.
The second octal constant [10000....b] has 22 digits = 64 bits.
Looks like 64-bit words to me.

| Easiest solution is to use a Cray. :-) Otherwise you
| are left with understanding what was intended. That means
| knowing enough about both how a Cray worked and what you
| problem needs. Both aspects are somewhere between awkward and
| very awkward.

Might not need any of that it you have a compiler
supporting 64-bit integers.

| The trailing B means Binary which is really Octal in case
| your recipe did not make sense to you. Why B for Octal remains
| a mystery that only the original Cray folks can explain. Most
| likely a case of choosing a name before they realized the possibility
| of generalizations.

The letter 'O' was probably avoided because it was easily confused with zero. 


0
Reply robin512 (309) 3/29/2011 2:05:10 PM

7 Replies
180 Views

(page loaded in 0.15 seconds)

Similiar Articles:





7/9/2012 8:02:00 PM


Reply: