Hi Can we implement the equation like A = X * ((1 + Y)**Z) in mainframe assembler
Where both Y and Z can be a floating point number like 2.35 or 3.256
If yes can you please let me how to do it
Thanks
Calculate the power of a floating point number
-
- Posts: 1
- Joined: Wed Nov 21, 2018 10:24 am
- Skillset: COBOL,JCL
- Referer: Internet
Re: Calculate the power of a floating point number
What have you tried so far, and what results did you get ?
What research have you done - as your question asks if it is possible or not - surely you have googled at least ?
What research have you done - as your question asks if it is possible or not - surely you have googled at least ?
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Calculate the power of a floating point number
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Calculate the power of a floating point number
I'm not so confident Mr. Sorichetti's link will be of direct assistance. The key is Y**Z where Y and Z are floating point. I don't think there is a single instruction to do Y**Z. If I ever knew how to do Y**Z, it has certainly flown away from my memory. Other than Y**Z the remainder is parsing out the operands and doing the arithmetic.
It's not so hard for an unregistered person to download the z/Architecture Principles of Operation. I just did that 11 days ago! It just takes some patience and Google.
It's not so hard for an unregistered person to download the z/Architecture Principles of Operation. I just did that 11 days ago! It just takes some patience and Google.
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Calculate the power of a floating point number
I knew that ...
but even doing simple arithmetics using floating point is not that easy
and the TS will NEED to look at the principles of operations anyway
the TS might want to do a bit of homework by looking at the links provided by a simple google search
using ibm assembler floating point examples

but even doing simple arithmetics using floating point is not that easy
and the TS will NEED to look at the principles of operations anyway
the TS might want to do a bit of homework by looking at the links provided by a simple google search
using ibm assembler floating point examples
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Calculate the power of a floating point number
just found this gem
http://idcp.marist.edu/enterprisesystem ... ervers.pdf
( one of the links returned googling as suggested )
http://idcp.marist.edu/enterprisesystem ... ervers.pdf
( one of the links returned googling as suggested )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Calculate the power of a floating point number
I've had that book for some time (April 2017). I found it, originally, through http://www.cbttape.org. Awfully long winded, though. As a text book, I'd estimate it has enough material for at least 4 semesters
Actually, when I said I got the z/Arch POP 11 days ago, it turned out I was mistaken. That was the last time I looked at it. The file was allocated August 23.
Actually, when I said I got the z/Arch POP 11 days ago, it turned out I was mistaken. That was the last time I looked at it. The file was allocated August 23.
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Calculate the power of a floating point number
Raghunaik3 wrote:Hi Can we implement the equation like A = X * ((1 + Y)**Z) in mainframe assembler
Where both Y and Z can be a floating point number like 2.35 or 3.256
If yes can you please let me how to do it
Thanks
Going back to the original question, I wrote up a little Fortran program -
Code: Select all
Y=57.2
Z=2.23
RES = Y ** Z
WRITE (6,2001) Y,Z,RES
2001 FORMAT(' ', F7.2, ' ** ',F7.2,' = ',F7.2)
STOP
END
I ran the program through the OS/360 Fortran G compiler in the hope its Assembler listing might provide some insight. It didn't. If I read it right, the code called a library routine to perform Y ** Z.
The output of the WRITE statement was
Code: Select all
57.20 ** 2.23 = 8298.35
This seems to be right.
-
- Posts: 239
- Joined: Wed Dec 04, 2013 11:08 pm
- Skillset: COBOL, JCL, ISPF.
- Referer: While searching the Internet for answers.
- Location: Richfield, MN, USA
Re: Calculate the power of a floating point number
The Windows 7 calculator gives Y ^ Z = 8298.38 (rounded to 2 decimals)
.... Terry
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Calculate the power of a floating point number
I got essentially the same result from Calc in LibreOffice.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
compare number lines of two dataset
by samb01 » Wed Nov 13, 2024 8:46 pm » in DFSORT/ICETOOL/ICEGENER - 6
- 2169
-
by sergeyken
View the latest post
Fri Nov 15, 2024 12:41 pm
-